Data-kansiossa on aineisto.
# load data
setwd("~/GitHub/tilataso")
library(readr)
tilat<-read.csv(file="kategoriset.csv", header=TRUE)
Valitsen muutaman jatkuvan muuttujan ja muutoin valitsen ne, joissa on alle 6 kategoriaa. Yhteenveto muuttujista:
colnames(tilat)[ apply(tilat, 2, anyNA) ]
## [1] "VAR00003" "TII_alusta_5_laatu" "TII_lelukomm"
## [4] "POR_pr_viemar" "VAR00001"
tilat<-tilat[ , apply(tilat, 2, function(x) !any(is.na(x)))]
summaryKable(tilat[,1:218]) %>%
kable("html", align = "rrr", caption = "Data variable summary") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px")
| Min | 1st Q | Median | Mean | 3rd Q | Max | |
|---|---|---|---|---|---|---|
| Haastrooli_1OmEiosall_2OmOsall_3Esimies | 1.000 | 2.000 | 2.000 | 1.884 | 2.000 | 3.000 |
| Tuotsuunta | 1.000 | 1.000 | 1.000 | 1.488 | 2.000 | 2.000 |
| Karjut_astsiem | 0.000 | 0.000 | 0.000 | 0.419 | 0.000 | 6.000 |
| Tautsu | 0.000 | 0.000 | 1.000 | 0.698 | 1.000 | 1.000 |
| Tautsuok | 0.000 | 0.000 | 0.000 | 0.488 | 1.000 | 1.000 |
| Tautsu_012 | 0.000 | 0.000 | 1.000 | 1.093 | 2.000 | 2.000 |
| Siilotkat | 0.000 | 1.000 | 1.000 | 0.907 | 1.000 | 1.000 |
| Tuhoei | 0.000 | 1.000 | 1.000 | 0.814 | 1.000 | 1.000 |
| Eikulkuih | 0.000 | 0.000 | 1.000 | 0.628 | 1.000 | 1.000 |
| Eikulkuel | 0.000 | 0.000 | 1.000 | 0.698 | 1.000 | 1.000 |
| Suojvar | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Suojvarpuh | 0.000 | 1.000 | 1.000 | 0.977 | 1.000 | 1.000 |
| Kadetpesu | 0.000 | 0.000 | 1.000 | 0.698 | 1.000 | 1.000 |
| Toimsiis | 0.000 | 1.000 | 1.000 | 0.953 | 1.000 | 1.000 |
| Saappesu | 0.000 | 0.000 | 1.000 | 0.721 | 1.000 | 1.000 |
| Lasthu | 0.000 | 1.000 | 1.000 | 0.837 | 1.000 | 1.000 |
| Teurkuski_0paaseesikalaan_1eipaase | 0.000 | 0.000 | 1.000 | 0.698 | 1.000 | 1.000 |
| JOU_kertayt_0ei | 0.000 | 0.000 | 0.000 | 0.163 | 0.000 | 1.000 |
| JOU_tuotvaiherill_0ei | 0.000 | 0.000 | 1.000 | 0.721 | 1.000 | 1.000 |
| JOU_pesu_0ei | 0.000 | 0.000 | 0.000 | 0.140 | 0.000 | 1.000 |
| JOU_pesuaine_0ei | 0.000 | 0.000 | 0.000 | 0.093 | 0.000 | 1.000 |
| JOU_desinf_liu_0ei_1liuos_2kuiva | 0.000 | 0.000 | 0.000 | 0.674 | 0.000 | 12.000 |
| JOU_tyhjana_mi1vrk_0ei | 0.000 | 0.000 | 0.000 | 0.302 | 1.000 | 1.000 |
| PORSOSASTO_kertayt_0ei | 0.000 | 0.000 | 0.000 | 0.419 | 1.000 | 1.000 |
| PORS_tuotvaiherill_0ei | 0.000 | 1.000 | 1.000 | 0.767 | 1.000 | 1.000 |
| PORS_pesu_0ei | 0.000 | 1.000 | 1.000 | 0.767 | 1.000 | 1.000 |
| PORS_pesuaine_0ei | 0.000 | 0.000 | 0.000 | 0.233 | 0.000 | 1.000 |
| PORS_desinf_0ei_1LIU_2KUIVA | 0.000 | 1.000 | 1.000 | 2.302 | 2.000 | 12.000 |
| PORS_tyhjana_mi1vr_0ei | 0.000 | 0.000 | 1.000 | 0.605 | 1.000 | 1.000 |
| Raa_0ei_1kontti_2huone | 0.000 | 1.000 | 1.000 | 2.000 | 1.000 | 12.000 |
| Raa_auto_hakee_0ei | 0.000 | 0.000 | 1.000 | 0.628 | 1.000 | 1.000 |
| Raa_viilea_0ei | 0.000 | 1.000 | 1.000 | 0.884 | 1.000 | 1.000 |
| Raa_tuhoelain_1eipaase_0paaseesic | 0.000 | 0.000 | 1.000 | 0.605 | 1.000 | 1.000 |
| Tuhoelmerkkeja_0kylla_1ei | 0.000 | 0.000 | 0.000 | 0.233 | 0.000 | 1.000 |
| Lintuja_0kylla_1ei | 0.000 | 1.000 | 1.000 | 0.767 | 1.000 | 1.000 |
| Tuho_ohjelma | 0.000 | 0.000 | 0.000 | 0.116 | 0.000 | 1.000 |
| kissoja0on1ei | 0.000 | 0.000 | 0.000 | 0.372 | 1.000 | 1.000 |
| Kotielain_sikalaan_0kylla_1ei | 0.000 | 1.000 | 1.000 | 0.791 | 1.000 | 1.000 |
| Vesi_1kunn_0oma | 0.000 | 0.000 | 1.000 | 0.628 | 1.000 | 1.000 |
| Ery | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Parvo | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Koli | 0.000 | 1.000 | 1.000 | 0.953 | 1.000 | 1.000 |
| Sirko | 0.000 | 0.000 | 0.000 | 0.302 | 1.000 | 1.000 |
| ClC | 0.000 | 0.000 | 0.000 | 0.070 | 0.000 | 1.000 |
| ClA | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| SI | 0.000 | 0.000 | 0.000 | 0.093 | 0.000 | 1.000 |
| APP | 0.000 | 0.000 | 0.000 | 0.116 | 0.000 | 1.000 |
| Loisaika_1ennenpors_2_porskars | 1.000 | 1.000 | 1.000 | 1.372 | 2.000 | 2.000 |
| Uusiryh | 1.000 | 2.000 | 2.000 | 2.000 | 2.000 | 4.000 |
| Ton_tiheys_1aina_2jaetaan | 1.000 | 1.000 | 1.000 | 1.093 | 1.000 | 2.000 |
| Yhdistaggrtmp_1eiongelma_2tmp_3eitmp | 1.000 | 2.000 | 2.000 | 4.349 | 3.000 | 12.000 |
| Muutelkaynn_0ei_1_satunn_2kaynnmuusaann | 0.000 | 0.000 | 1.000 | 0.767 | 1.000 | 2.000 |
| maitokuume | 0.000 | 0.000 | 1.000 | 0.512 | 1.000 | 1.000 |
| metriitti | 0.000 | 0.000 | 0.000 | 0.442 | 1.000 | 1.000 |
| valuttelu | 0.000 | 0.000 | 0.000 | 0.116 | 0.000 | 1.000 |
| mastiitti | 0.000 | 0.000 | 0.000 | 0.233 | 0.000 | 1.000 |
| ontuma | 0.000 | 0.000 | 1.000 | 0.721 | 1.000 | 1.000 |
| syomattomyys | 0.000 | 0.000 | 1.000 | 0.512 | 1.000 | 1.000 |
| kuume | 0.000 | 0.000 | 0.000 | 0.140 | 0.000 | 1.000 |
| loukkaantuminen | 0.000 | 0.000 | 0.000 | 0.372 | 1.000 | 1.000 |
| AB_rutiinilaak | 0.000 | 0.000 | 0.000 | 0.140 | 0.000 | 1.000 |
| Oksitosiini_rutiinisti | 0.000 | 0.000 | 0.000 | 0.395 | 1.000 | 1.000 |
| Kaynnistys_rutiinisti | 0.000 | 0.000 | 0.000 | 0.093 | 0.000 | 1.000 |
| NSAID_porsituksessa_rutiini | 0.000 | 0.000 | 0.000 | 0.233 | 0.000 | 1.000 |
| OMATENSIKOT_0EI_1KYLLa | 0.000 | 0.000 | 1.000 | 0.651 | 1.000 | 1.000 |
| Ensikk_valisiirtkars_ennensiem | 0.000 | 0.000 | 0.000 | 0.395 | 1.000 | 1.000 |
| Ensikk_kiihruok | 0.000 | 0.000 | 0.000 | 0.372 | 1.000 | 1.000 |
| Ensikk_karjukontaktiensi_0hajutainako_1aidanlapi_2kars | 0.000 | 1.000 | 1.000 | 0.953 | 1.000 | 2.000 |
| siemika | 7.000 | 8.000 | 8.000 | 8.070 | 8.000 | 9.500 |
| Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk | 1.000 | 3.000 | 3.000 | 2.884 | 3.000 | 4.000 |
| Kiimantark_ryhmakaytt | 0.000 | 1.000 | 1.000 | 0.884 | 1.000 | 1.000 |
| Kiimantarkalkaa_vrkvier | 0.000 | 0.000 | 1.000 | 1.302 | 1.000 | 5.000 |
| Kiimamerk_emakonselka | 0.000 | 1.000 | 1.000 | 0.860 | 1.000 | 1.000 |
| Kiimantark_postsiem | 0.000 | 1.000 | 1.000 | 0.953 | 1.000 | 1.000 |
| Postsiem_ryhmakaytt_havainnointi | 0.000 | 1.000 | 1.000 | 0.884 | 1.000 | 1.000 |
| Tiin_ultra2 | 6.000 | 6.000 | 6.000 | 6.140 | 6.000 | 10.000 |
| Tiin_ultra_1yhdesti_2kahdesti | 0.000 | 1.000 | 1.000 | 1.000 | 1.000 | 2.000 |
| Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen | 0.000 | 0.000 | 2.000 | 1.953 | 4.000 | 4.000 |
| Pesantekomatmaara_1runsas_2jnkv_3niukka | 1.000 | 2.000 | 2.000 | 2.093 | 2.000 | 3.000 |
| Sisatutk_ennenoksitos | 0.000 | 0.000 | 0.000 | 0.349 | 1.000 | 1.000 |
| Porsitusaputekn_1empesu_2kaspesu_3kasine_4liukaste | 34.000 | 34.000 | 134.000 | 305.628 | 134.000 | 1234.000 |
| PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa | 1.000 | 2.000 | 2.000 | 1.814 | 2.000 | 2.000 |
| Ruoksu_0ei_1itse_2neuvoja_3kyllaeitietoa | 1.000 | 2.000 | 2.000 | 2.953 | 2.000 | 12.000 |
| Yksilöll_ruokinta | 0.000 | 0.000 | 1.000 | 0.721 | 1.000 | 1.000 |
| AS_1ast_jout_samassa_2asteiole | 1.000 | 2.000 | 2.000 | 1.837 | 2.000 | 2.000 |
| AS_er_os_lkm | 1.000 | 1.000 | 1.000 | 1.093 | 1.000 | 2.000 |
| AS_em_kars | 2.500 | 7.500 | 7.500 | 8.605 | 7.500 | 60.000 |
| AS_karspit | 3.310 | 5.940 | 5.940 | 6.195 | 5.940 | 20.000 |
| AS_karslev | 2.670 | 4.800 | 4.800 | 4.807 | 4.800 | 7.000 |
| AS_meluton | 0.000 | 1.000 | 1.000 | 0.907 | 1.000 | 1.000 |
| AS_haittael_ei | 0.000 | 1.000 | 1.000 | 0.860 | 1.000 | 1.000 |
| AS_haittael_laatu | 1.000 | 1.000 | 1.000 | 2.070 | 4.000 | 4.000 |
| AS_ilma_aistin | 0.000 | 0.000 | 0.000 | 0.186 | 0.000 | 1.000 |
| AS_ilma_amm | 0.000 | 0.000 | 0.000 | 0.186 | 0.000 | 1.000 |
| AS_ilma_pöly | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_ilma_muu | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_kosteus | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_valaistus | 0.000 | 0.000 | 0.000 | 0.047 | 0.000 | 1.000 |
| AS_alusta12345 | 1.000 | 1.000 | 1.000 | 2.791 | 1.000 | 12.000 |
| AS_alusta_5_laatu | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_latt_rakenne1234 | 12.000 | 13.000 | 13.000 | 12.837 | 13.000 | 13.000 |
| AS_pr_ritila | 0.000 | 0.000 | 0.000 | 4.279 | 0.000 | 41.000 |
| AS_pr_viemar | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_kuiv_mat12345 | 1.000 | 1.500 | 1.500 | 2.012 | 1.500 | 14.000 |
| AS_kuiv_5_mika | 0.000 | 3.000 | 3.000 | 2.884 | 3.000 | 4.000 |
| AS_maara1234 | 0.000 | 4.000 | 4.000 | 3.698 | 4.000 | 4.000 |
| AS_tonkimat123456 | 1.000 | 1.000 | 1.000 | 1.349 | 1.000 | 12.000 |
| AS_tonkimat_6_mika | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_mat_vaiht | 0.000 | 1.000 | 1.000 | 0.953 | 1.000 | 1.000 |
| AS_maara123 | 0.000 | 2.000 | 2.000 | 2.070 | 2.000 | 3.000 |
| AS_annostelu1234 | 0.000 | 1.000 | 1.000 | 1.000 | 1.000 | 3.000 |
| AS_lannanpoisto12 | 0.000 | 2.000 | 2.000 | 2.116 | 2.000 | 12.000 |
| AS_rak_kunto | 0.000 | 0.000 | 0.000 | 0.023 | 0.000 | 1.000 |
| AS_latt_pitava | 0.000 | 0.000 | 0.000 | 0.023 | 0.000 | 1.000 |
| AS_sairkars | 0.000 | 0.000 | 0.000 | 0.256 | 0.500 | 1.000 |
| AS_sk_parempi | 0.000 | 1.000 | 1.000 | 0.849 | 1.000 | 1.000 |
| AS_sk_kiintea | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_sk_kuivike | 0.000 | 0.000 | 0.000 | 0.093 | 0.000 | 1.000 |
| AS_sk_siisti | 0.000 | 0.000 | 0.000 | 0.070 | 0.000 | 1.000 |
| AS_sk_kuiva | 0.000 | 0.000 | 0.000 | 0.035 | 0.000 | 1.000 |
| AS_sk_syörauha | 0.000 | 0.000 | 0.000 | 0.116 | 0.000 | 1.000 |
| AS_sk_juorauha | 0.000 | 0.000 | 0.000 | 0.116 | 0.000 | 1.000 |
| AS_ruoklaite12345 | 0.000 | 4.000 | 4.000 | 3.814 | 4.000 | 4.000 |
| AS_ruokpaikka | 0.000 | 1.000 | 1.000 | 1.047 | 1.000 | 4.000 |
| AS_ruokpuht | 0.000 | 0.000 | 0.000 | 0.140 | 0.000 | 1.000 |
| AS_juomalaite123 | 0.000 | 1.000 | 1.000 | 0.977 | 1.000 | 1.000 |
| AS_juonalkm | 0.222 | 1.000 | 1.000 | 1.011 | 1.000 | 2.250 |
| AS_juomapuht | 0.000 | 0.000 | 0.000 | 0.023 | 0.000 | 1.000 |
| AS_juomatoim | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| AS_rauhallisuus123 | 0.000 | 1.000 | 1.000 | 0.953 | 1.000 | 1.000 |
| AS_hoitotarveKE | 1.000 | 1.000 | 1.000 | 1.442 | 2.000 | 2.000 |
| AS_stereo | 0.000 | 0.000 | 0.000 | 0.140 | 0.000 | 1.000 |
| TII_1ast_jout_samassa_2asteiole | 0.000 | 0.000 | 0.000 | 0.186 | 0.000 | 2.000 |
| TII_valiseinat | 0.000 | 0.000 | 0.000 | 0.488 | 0.000 | 16.000 |
| TII_meluton | 0.000 | 1.000 | 1.000 | 0.791 | 1.000 | 1.000 |
| TII_haittael_ei | 0.000 | 1.000 | 1.000 | 0.767 | 1.000 | 1.000 |
| TII_ilma_aistin | 0.000 | 0.000 | 0.000 | 0.116 | 0.000 | 1.000 |
| TII_ilma_amm | 0.000 | 0.000 | 0.000 | 0.140 | 0.000 | 1.000 |
| TII_ilma_pöly | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| TII_ilma_muu | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| TII_kosteus | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| TII_valaistus | 0.000 | 0.000 | 0.000 | 0.023 | 0.000 | 1.000 |
| TII_alusta12345 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| TII_latt_rakenne1234 | 1.000 | 13.000 | 13.000 | 11.744 | 13.000 | 23.000 |
| TII_pr_ritila | 0.000 | 0.000 | 0.000 | 4.140 | 0.000 | 50.000 |
| TII_pr_viemar | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| TII_kuiv_mat12345 | 1.000 | 2.000 | 2.000 | 3.721 | 2.000 | 15.000 |
| TII_kuiv_5_mika | 1.000 | 1.000 | 1.000 | 1.023 | 1.000 | 2.000 |
| TII_maara1234 | 1.000 | 3.000 | 3.000 | 3.349 | 3.000 | 23.000 |
| TII_tonkimat_6_mika | 1.000 | 1.000 | 1.000 | 1.326 | 1.000 | 5.000 |
| TII_lelu1234 | 2.000 | 4.000 | 4.000 | 4.395 | 4.000 | 24.000 |
| TII_mat_vaiht | 0.000 | 1.000 | 1.000 | 0.977 | 1.000 | 1.000 |
| TII_maara123 | 1.000 | 2.000 | 2.000 | 1.930 | 2.000 | 3.000 |
| TII_annostelu1234 | 1.000 | 1.000 | 1.000 | 1.163 | 1.000 | 4.000 |
| TII_lannanpoisto12 | 1.000 | 1.000 | 1.000 | 2.535 | 5.000 | 5.000 |
| TII_rak_kunto | 0.000 | 0.000 | 0.000 | 0.047 | 0.000 | 1.000 |
| TII_latt_pitava | 0.000 | 0.000 | 0.000 | 0.070 | 0.000 | 1.000 |
| TII_sairkars | 0.000 | 1.000 | 1.000 | 0.907 | 1.000 | 1.000 |
| TII_ruok_0nonlock_1lock | 0.000 | 0.000 | 0.000 | 0.395 | 1.000 | 1.000 |
| TII_ruokpuht | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| TII_juomalaite123 | 1.000 | 1.000 | 1.000 | 1.279 | 1.000 | 12.000 |
| TII_juomapuht | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| TII_juomatoim | 0.000 | 0.000 | 0.000 | 0.047 | 0.000 | 2.000 |
| TII_rauhallisuus123 | 1.000 | 1.000 | 1.000 | 1.023 | 1.000 | 2.000 |
| TII_hoitotarveKE | 1.000 | 1.000 | 2.000 | 1.512 | 2.000 | 2.000 |
| TII_stereo | 0.000 | 0.000 | 0.000 | 0.093 | 0.000 | 1.000 |
| POR_meluton | 0.000 | 1.000 | 1.000 | 0.767 | 1.000 | 1.000 |
| POR_haittael_ei | 0.000 | 1.000 | 1.000 | 0.860 | 1.000 | 1.000 |
| POR_haittael_laatu | 1.000 | 1.000 | 1.000 | 2.186 | 4.000 | 4.000 |
| POR_ilma_aistin | 0.000 | 0.000 | 0.000 | 0.023 | 0.000 | 1.000 |
| POR_ilma_amm | 0.000 | 0.000 | 0.000 | 0.023 | 0.000 | 1.000 |
| POR_ilma_pöly | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| POR_ilma_muu | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| POR_kosteus | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| POR_valaistus | 0.000 | 0.000 | 0.000 | 0.058 | 0.000 | 1.000 |
| POR_latt_rakenne1234 | 1.000 | 12.000 | 12.000 | 13.395 | 12.000 | 123.000 |
| POR_pr_rako | 0.000 | 0.000 | 0.000 | 0.884 | 0.000 | 38.000 |
| POR_maara1234 | 2.000 | 3.000 | 3.000 | 2.953 | 3.000 | 4.000 |
| POR_tonkimat_6_mika | 1.000 | 1.000 | 1.000 | 1.442 | 1.000 | 5.000 |
| POR_lelu1234 | 2.000 | 4.000 | 4.000 | 3.930 | 4.000 | 5.000 |
| POR_lelukomm | 1.000 | 1.000 | 1.000 | 1.140 | 1.000 | 4.000 |
| POR_mat_vaiht | 1.000 | 1.000 | 1.000 | 1.023 | 1.000 | 2.000 |
| POR_maara123 | 1.000 | 2.000 | 2.000 | 2.000 | 2.000 | 3.000 |
| POR_annostelu1234 | 1.000 | 1.000 | 1.000 | 1.233 | 1.000 | 4.000 |
| POR_lannanpoisto12 | 1.000 | 2.000 | 2.000 | 1.907 | 2.000 | 2.000 |
| POR_rak_kunto | 0.000 | 0.000 | 0.000 | 0.070 | 0.000 | 1.000 |
| POR_latt_pitava | 0.000 | 0.000 | 0.000 | 0.070 | 0.000 | 1.000 |
| POR_sairkars | 1.000 | 1.000 | 1.000 | 1.860 | 3.000 | 5.000 |
| POR_ruoklaite12345 | 2.000 | 2.500 | 2.500 | 3.012 | 2.500 | 25.000 |
| POR_ruokpaikka | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| POR_ruokpuht | 0.000 | 0.000 | 0.000 | 0.070 | 0.000 | 1.000 |
| POR_juomalaite123 | 1.000 | 1.000 | 1.000 | 1.279 | 1.000 | 13.000 |
| POR_juonalkm | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| POR_juomapuht | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| POR_juomatoim | 0.000 | 0.000 | 0.000 | 0.023 | 0.000 | 1.000 |
| POR_rauhallisuus123 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Hajukarjut_per_emakko | 0.000 | 0.010 | 0.010 | 0.013 | 0.015 | 0.060 |
| TII_VIRMaa_0_ei_1pellel_2pelvir_3niukuihiemnvir_4riirunkuiv | 0.000 | 2.000 | 3.000 | 2.884 | 4.000 | 4.000 |
| TII_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme | 0.000 | 1.000 | 2.000 | 1.884 | 3.000 | 3.000 |
| AS_VIRMaa_0ei_1pellel_2pelvir_3niukuihiemvir_4riirunkuiv | 0.000 | 1.000 | 2.000 | 2.047 | 3.000 | 4.000 |
| AS_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme | 0.000 | 1.000 | 1.000 | 1.442 | 2.000 | 3.000 |
| POR_VIRMaa_0_ei_1pellel_2pelvir_3niukui_4riikuiv | 0.000 | 2.000 | 3.000 | 2.698 | 3.500 | 4.000 |
| POR_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme | 0.000 | 1.500 | 2.000 | 1.791 | 2.000 | 3.000 |
| Koulmax_1peru_2ops_3a_4amk_5yl | 2.000 | 3.000 | 3.000 | 3.209 | 3.000 | 5.000 |
| Stressi_1erpal_4jnkv | 1.000 | 2.000 | 3.000 | 2.884 | 4.000 | 4.000 |
| EMKUOLLJAKO | 0.000 | 0.000 | 0.000 | 0.465 | 1.000 | 1.000 |
| EMPOISJAKO | 0.000 | 0.000 | 0.000 | 0.442 | 1.000 | 1.000 |
| EMENKUOLLJAKO | 0.000 | 0.000 | 0.000 | 0.419 | 1.000 | 1.000 |
| EMENPOISJAKO | 0.000 | 0.000 | 0.000 | 0.372 | 1.000 | 1.000 |
| NIVEL_01 | 1.000 | 1.000 | 1.000 | 1.419 | 2.000 | 2.000 |
| PAISE_01 | 1.000 | 1.000 | 1.000 | 1.419 | 2.000 | 2.000 |
| MAKUU01 | 1.000 | 1.000 | 1.000 | 1.419 | 2.000 | 2.000 |
| KOKO_01 | 1.000 | 1.000 | 1.000 | 1.419 | 2.000 | 2.000 |
| OSA_01 | 1.000 | 1.000 | 1.000 | 1.419 | 2.000 | 2.000 |
| JOKUHYLK_01 | 1.000 | 1.000 | 1.000 | 1.419 | 2.000 | 2.000 |
| PLEUR_01 | 0.000 | 0.000 | 0.000 | 0.279 | 1.000 | 1.000 |
| PNEUM_01 | 1.000 | 1.000 | 1.000 | 1.419 | 2.000 | 2.000 |
| SAIRKARS_AST_TII | 0.000 | 1.000 | 1.000 | 0.767 | 1.000 | 1.000 |
KreateTableOne = function(x, ...){
t1 = tableone::CreateTableOne(data=x, ...)
t2 = print(t1, quote=TRUE)
rownames(t2) = gsub(pattern='\\"', replacement='', rownames(t2))
colnames(t2) = gsub(pattern='\\"', replacement='', colnames(t2))
return(t2)
}
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
tilatkat<-tilat[,1:218]%>%mutate_all(as.factor)
tilatkat$EMKUOL<-tilat$EMKUOLLJAKO
table1 = KreateTableOne(x=tilatkat, strata='EMKUOL')
table1%>%
kable("html", align = "rrr", caption = "Data variable summary strat by EMKUOL") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 23 | 20 | ||
| Haastrooli_1OmEiosall_2OmOsall_3Esimies (%) | 0.431 | |||
| 1 | 4 ( 17.4) | 6 ( 30.0) | ||
| 2 | 17 ( 73.9) | 11 ( 55.0) | ||
| 3 | 2 ( 8.7) | 3 ( 15.0) | ||
| Tuotsuunta = 2 (%) | 14 ( 60.9) | 7 ( 35.0) | 0.165 | |
| Karjut_astsiem (%) | 0.264 | |||
| 0 | 21 ( 91.3) | 17 ( 85.0) | ||
| 1 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 6 | 0 ( 0.0) | 2 ( 10.0) | ||
| Tautsu = 1 (%) | 15 ( 65.2) | 15 ( 75.0) | 0.716 | |
| Tautsuok = 1 (%) | 9 ( 39.1) | 12 ( 60.0) | 0.289 | |
| Tautsu_012 (%) | 0.733 | |||
| 0 | 8 ( 34.8) | 5 ( 25.0) | ||
| 1 | 7 ( 30.4) | 6 ( 30.0) | ||
| 2 | 8 ( 34.8) | 9 ( 45.0) | ||
| Siilotkat = 1 (%) | 21 ( 91.3) | 18 ( 90.0) | 1.000 | |
| Tuhoei = 1 (%) | 16 ( 69.6) | 19 ( 95.0) | 0.081 | |
| Eikulkuih = 1 (%) | 16 ( 69.6) | 11 ( 55.0) | 0.503 | |
| Eikulkuel = 1 (%) | 14 ( 60.9) | 16 ( 80.0) | 0.303 | |
| Suojvar = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| Suojvarpuh = 1 (%) | 23 (100.0) | 19 ( 95.0) | 0.944 | |
| Kadetpesu = 1 (%) | 14 ( 60.9) | 16 ( 80.0) | 0.303 | |
| Toimsiis = 1 (%) | 22 ( 95.7) | 19 ( 95.0) | 1.000 | |
| Saappesu = 1 (%) | 14 ( 60.9) | 17 ( 85.0) | 0.156 | |
| Lasthu = 1 (%) | 19 ( 82.6) | 17 ( 85.0) | 1.000 | |
| Teurkuski_0paaseesikalaan_1eipaase = 1 (%) | 17 ( 73.9) | 13 ( 65.0) | 0.763 | |
| JOU_kertayt_0ei = 1 (%) | 3 ( 13.0) | 4 ( 20.0) | 0.840 | |
| JOU_tuotvaiherill_0ei = 1 (%) | 16 ( 69.6) | 15 ( 75.0) | 0.956 | |
| JOU_pesu_0ei = 1 (%) | 4 ( 17.4) | 2 ( 10.0) | 0.798 | |
| JOU_pesuaine_0ei = 1 (%) | 2 ( 8.7) | 2 ( 10.0) | 1.000 | |
| JOU_desinf_liu_0ei_1liuos_2kuiva (%) | 0.406 | |||
| 0 | 20 ( 87.0) | 18 ( 90.0) | ||
| 1 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2 | 2 ( 8.7) | 0 ( 0.0) | ||
| 12 | 1 ( 4.3) | 1 ( 5.0) | ||
| JOU_tyhjana_mi1vrk_0ei = 1 (%) | 5 ( 21.7) | 8 ( 40.0) | 0.333 | |
| PORSOSASTO_kertayt_0ei = 1 (%) | 9 ( 39.1) | 9 ( 45.0) | 0.937 | |
| PORS_tuotvaiherill_0ei = 1 (%) | 19 ( 82.6) | 14 ( 70.0) | 0.539 | |
| PORS_pesu_0ei = 1 (%) | 17 ( 73.9) | 16 ( 80.0) | 0.913 | |
| PORS_pesuaine_0ei = 1 (%) | 4 ( 17.4) | 6 ( 30.0) | 0.539 | |
| PORS_desinf_0ei_1LIU_2KUIVA (%) | 0.623 | |||
| 0 | 5 ( 21.7) | 4 ( 20.0) | ||
| 1 | 9 ( 39.1) | 10 ( 50.0) | ||
| 2 | 7 ( 30.4) | 3 ( 15.0) | ||
| 12 | 2 ( 8.7) | 3 ( 15.0) | ||
| PORS_tyhjana_mi1vr_0ei = 1 (%) | 13 ( 56.5) | 13 ( 65.0) | 0.799 | |
| Raa_0ei_1kontti_2huone (%) | 0.456 | |||
| 0 | 2 ( 8.7) | 1 ( 5.0) | ||
| 1 | 19 ( 82.6) | 15 ( 75.0) | ||
| 2 | 0 ( 0.0) | 2 ( 10.0) | ||
| 12 | 2 ( 8.7) | 2 ( 10.0) | ||
| Raa_auto_hakee_0ei = 1 (%) | 16 ( 69.6) | 11 ( 55.0) | 0.503 | |
| Raa_viilea_0ei = 1 (%) | 21 ( 91.3) | 17 ( 85.0) | 0.868 | |
| Raa_tuhoelain_1eipaase_0paaseesic = 1 (%) | 13 ( 56.5) | 13 ( 65.0) | 0.799 | |
| Tuhoelmerkkeja_0kylla_1ei = 1 (%) | 5 ( 21.7) | 5 ( 25.0) | 1.000 | |
| Lintuja_0kylla_1ei = 1 (%) | 19 ( 82.6) | 14 ( 70.0) | 0.539 | |
| Tuho_ohjelma = 1 (%) | 2 ( 8.7) | 3 ( 15.0) | 0.868 | |
| kissoja0on1ei (%) | 0.005 | |||
| 0 | 19 ( 82.6) | 7 ( 35.0) | ||
| 0.5 | 0 ( 0.0) | 2 ( 10.0) | ||
| 1 | 4 ( 17.4) | 11 ( 55.0) | ||
| Kotielain_sikalaan_0kylla_1ei = 1 (%) | 17 ( 73.9) | 17 ( 85.0) | 0.606 | |
| Vesi_1kunn_0oma = 1 (%) | 16 ( 69.6) | 11 ( 55.0) | 0.503 | |
| Ery = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| Parvo = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| Koli = 1 (%) | 22 ( 95.7) | 19 ( 95.0) | 1.000 | |
| Sirko = 1 (%) | 8 ( 34.8) | 5 ( 25.0) | 0.716 | |
| ClC = 1 (%) | 1 ( 4.3) | 2 ( 10.0) | 0.900 | |
| ClA = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| SI = 1 (%) | 1 ( 4.3) | 3 ( 15.0) | 0.501 | |
| APP = 1 (%) | 3 ( 13.0) | 2 ( 10.0) | 1.000 | |
| Loisaika_1ennenpors_2_porskars = 2 (%) | 9 ( 39.1) | 7 ( 35.0) | 1.000 | |
| Uusiryh (%) | 0.524 | |||
| 1 | 1 ( 4.3) | 2 ( 10.0) | ||
| 2 | 20 ( 87.0) | 18 ( 90.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| 4 | 1 ( 4.3) | 0 ( 0.0) | ||
| Ton_tiheys_1aina_2jaetaan = 2 (%) | 4 ( 17.4) | 0 ( 0.0) | 0.152 | |
| Yhdistaggrtmp_1eiongelma_2tmp_3eitmp (%) | 0.334 | |||
| 1 | 4 ( 17.4) | 1 ( 5.0) | ||
| 2 | 9 ( 39.1) | 13 ( 65.0) | ||
| 3 | 4 ( 17.4) | 2 ( 10.0) | ||
| 12 | 6 ( 26.1) | 4 ( 20.0) | ||
| Muutelkaynn_0ei_1_satunn_2kaynnmuusaann (%) | 0.142 | |||
| 0 | 10 ( 43.5) | 6 ( 30.0) | ||
| 1 | 12 ( 52.2) | 9 ( 45.0) | ||
| 2 | 1 ( 4.3) | 5 ( 25.0) | ||
| maitokuume = 1 (%) | 12 ( 52.2) | 10 ( 50.0) | 1.000 | |
| metriitti = 1 (%) | 10 ( 43.5) | 9 ( 45.0) | 1.000 | |
| valuttelu = 1 (%) | 2 ( 8.7) | 3 ( 15.0) | 0.868 | |
| mastiitti = 1 (%) | 4 ( 17.4) | 6 ( 30.0) | 0.539 | |
| ontuma = 1 (%) | 15 ( 65.2) | 16 ( 80.0) | 0.461 | |
| syomattomyys = 1 (%) | 10 ( 43.5) | 12 ( 60.0) | 0.438 | |
| kuume = 1 (%) | 2 ( 8.7) | 4 ( 20.0) | 0.531 | |
| loukkaantuminen = 1 (%) | 10 ( 43.5) | 6 ( 30.0) | 0.551 | |
| AB_rutiinilaak = 1 (%) | 2 ( 8.7) | 4 ( 20.0) | 0.531 | |
| Oksitosiini_rutiinisti = 1 (%) | 8 ( 34.8) | 9 ( 45.0) | 0.711 | |
| Kaynnistys_rutiinisti = 1 (%) | 0 ( 0.0) | 4 ( 20.0) | 0.084 | |
| NSAID_porsituksessa_rutiini = 1 (%) | 6 ( 26.1) | 4 ( 20.0) | 0.913 | |
| OMATENSIKOT_0EI_1KYLLa = 1 (%) | 15 ( 65.2) | 13 ( 65.0) | 1.000 | |
| Ensikk_valisiirtkars_ennensiem = 1 (%) | 8 ( 34.8) | 9 ( 45.0) | 0.711 | |
| Ensikk_kiihruok = 1 (%) | 8 ( 34.8) | 8 ( 40.0) | 0.971 | |
| Ensikk_karjukontaktiensi_0hajutainako_1aidanlapi_2kars (%) | 0.401 | |||
| 0 | 2 ( 8.7) | 2 ( 10.0) | ||
| 1 | 19 ( 82.6) | 18 ( 90.0) | ||
| 2 | 2 ( 8.7) | 0 ( 0.0) | ||
| siemika (%) | 0.208 | |||
| 7 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7.5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 8 | 20 ( 87.0) | 14 ( 70.0) | ||
| 8.5 | 0 ( 0.0) | 4 ( 20.0) | ||
| 9.5 | 1 ( 4.3) | 1 ( 5.0) | ||
| Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk (%) | 0.386 | |||
| 1 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 3 ( 13.0) | 2 ( 10.0) | ||
| 3 | 17 ( 73.9) | 18 ( 90.0) | ||
| 4 | 2 ( 8.7) | 0 ( 0.0) | ||
| Kiimantark_ryhmakaytt = 1 (%) | 20 ( 87.0) | 18 ( 90.0) | 1.000 | |
| Kiimantarkalkaa_vrkvier (%) | 0.264 | |||
| 0 | 7 ( 30.4) | 5 ( 25.0) | ||
| 1 | 14 ( 60.9) | 9 ( 45.0) | ||
| 3 | 0 ( 0.0) | 3 ( 15.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 2 ( 8.7) | 2 ( 10.0) | ||
| Kiimamerk_emakonselka = 1 (%) | 17 ( 73.9) | 20 (100.0) | 0.043 | |
| Kiimantark_postsiem = 1 (%) | 21 ( 91.3) | 20 (100.0) | 0.532 | |
| Postsiem_ryhmakaytt_havainnointi = 1 (%) | 20 ( 87.0) | 18 ( 90.0) | 1.000 | |
| Tiin_ultra2 (%) | 0.364 | |||
| 6 | 22 ( 95.7) | 19 ( 95.0) | ||
| 8 | 1 ( 4.3) | 0 ( 0.0) | ||
| 10 | 0 ( 0.0) | 1 ( 5.0) | ||
| Tiin_ultra_1yhdesti_2kahdesti (%) | 0.533 | |||
| 0 | 5 ( 21.7) | 2 ( 10.0) | ||
| 1 | 15 ( 65.2) | 14 ( 70.0) | ||
| 2 | 3 ( 13.0) | 4 ( 20.0) | ||
| Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen (%) | 0.115 | |||
| 0 | 10 ( 43.5) | 6 ( 30.0) | ||
| 1 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2 | 2 ( 8.7) | 6 ( 30.0) | ||
| 3 | 2 ( 8.7) | 0 ( 0.0) | ||
| 4 | 9 ( 39.1) | 6 ( 30.0) | ||
| Pesantekomatmaara_1runsas_2jnkv_3niukka (%) | 0.763 | |||
| 1 | 1 ( 4.3) | 2 ( 10.0) | ||
| 2 | 18 ( 78.3) | 15 ( 75.0) | ||
| 3 | 4 ( 17.4) | 3 ( 15.0) | ||
| Sisatutk_ennenoksitos = 1 (%) | 7 ( 30.4) | 8 ( 40.0) | 0.737 | |
| Porsitusaputekn_1empesu_2kaspesu_3kasine_4liukaste (%) | 0.570 | |||
| 34 | 8 ( 34.8) | 7 ( 35.0) | ||
| 124 | 2 ( 8.7) | 0 ( 0.0) | ||
| 134 | 8 ( 34.8) | 9 ( 45.0) | ||
| 234 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1234 | 4 ( 17.4) | 4 ( 20.0) | ||
| PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa = 2 (%) | 19 ( 82.6) | 16 ( 80.0) | 1.000 | |
| Ruoksu_0ei_1itse_2neuvoja_3kyllaeitietoa (%) | 0.897 | |||
| 1 | 1 ( 4.3) | 1 ( 5.0) | ||
| 2 | 19 ( 82.6) | 15 ( 75.0) | ||
| 3 | 1 ( 4.3) | 2 ( 10.0) | ||
| 12 | 2 ( 8.7) | 2 ( 10.0) | ||
| Yksilöll_ruokinta = 1 (%) | 17 ( 73.9) | 14 ( 70.0) | 1.000 | |
| AS_1ast_jout_samassa_2asteiole = 2 (%) | 18 ( 78.3) | 18 ( 90.0) | 0.531 | |
| AS_er_os_lkm = 2 (%) | 2 ( 8.7) | 2 ( 10.0) | 1.000 | |
| AS_em_kars (%) | 0.400 | |||
| 2.5 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.0) | ||
| 7.5 | 21 ( 91.3) | 18 ( 90.0) | ||
| 8 | 0 ( 0.0) | 1 ( 5.0) | ||
| 60 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_karspit (%) | 0.429 | |||
| 3.31 | 1 ( 4.3) | 0 ( 0.0) | ||
| 4.4 | 1 ( 4.3) | 0 ( 0.0) | ||
| 5.94 | 20 ( 87.0) | 19 ( 95.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.0) | ||
| 20 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_karslev (%) | 0.429 | |||
| 2.67 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3.02 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4.8 | 20 ( 87.0) | 19 ( 95.0) | ||
| 6.8 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_meluton = 1 (%) | 21 ( 91.3) | 18 ( 90.0) | 1.000 | |
| AS_haittael_ei = 1 (%) | 20 ( 87.0) | 17 ( 85.0) | 1.000 | |
| AS_haittael_laatu (%) | 0.637 | |||
| 1 | 15 ( 65.2) | 11 ( 55.0) | ||
| 2 | 1 ( 4.3) | 1 ( 5.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| 4 | 6 ( 26.1) | 8 ( 40.0) | ||
| AS_ilma_aistin = 1 (%) | 3 ( 13.0) | 5 ( 25.0) | 0.540 | |
| AS_ilma_amm = 1 (%) | 3 ( 13.0) | 5 ( 25.0) | 0.540 | |
| AS_ilma_pöly = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_ilma_muu = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_kosteus = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_valaistus = 1 (%) | 1 ( 4.3) | 1 ( 5.0) | 1.000 | |
| AS_alusta12345 = 12 (%) | 2 ( 8.7) | 5 ( 25.0) | 0.303 | |
| AS_alusta_5_laatu = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_latt_rakenne1234 = 13 (%) | 21 ( 91.3) | 15 ( 75.0) | 0.303 | |
| AS_pr_ritila (%) | 0.535 | |||
| 0 | 21 ( 91.3) | 15 ( 75.0) | ||
| 20 | 1 ( 4.3) | 2 ( 10.0) | ||
| 25 | 1 ( 4.3) | 1 ( 5.0) | ||
| 33 | 0 ( 0.0) | 1 ( 5.0) | ||
| 41 | 0 ( 0.0) | 1 ( 5.0) | ||
| AS_pr_viemar = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_kuiv_mat12345 (%) | 0.397 | |||
| 1 | 2 ( 8.7) | 2 ( 10.0) | ||
| 1.5 | 19 ( 82.6) | 16 ( 80.0) | ||
| 2 | 0 ( 0.0) | 2 ( 10.0) | ||
| 12 | 1 ( 4.3) | 0 ( 0.0) | ||
| 14 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_kuiv_5_mika (%) | 0.157 | |||
| 0 | 0 ( 0.0) | 2 ( 10.0) | ||
| 3 | 23 (100.0) | 17 ( 85.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.0) | ||
| AS_maara1234 (%) | 0.372 | |||
| 0 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 3 | 1 ( 4.3) | 3 ( 15.0) | ||
| 4 | 20 ( 87.0) | 16 ( 80.0) | ||
| AS_tonkimat123456 (%) | 0.364 | |||
| 1 | 22 ( 95.7) | 19 ( 95.0) | ||
| 5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 12 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_tonkimat_6_mika = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_mat_vaiht = 1 (%) | 22 ( 95.7) | 19 ( 95.0) | 1.000 | |
| AS_maara123 (%) | 0.054 | |||
| 0 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2 | 18 ( 78.3) | 19 ( 95.0) | ||
| 3 | 5 ( 21.7) | 0 ( 0.0) | ||
| AS_annostelu1234 (%) | 0.639 | |||
| 0 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 21 ( 91.3) | 19 ( 95.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_lannanpoisto12 (%) | 0.524 | |||
| 0 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1 | 1 ( 4.3) | 2 ( 10.0) | ||
| 2 | 20 ( 87.0) | 18 ( 90.0) | ||
| 12 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_rak_kunto = 1 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| AS_latt_pitava = 1 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| AS_sairkars = 1 (%) | 3 ( 13.0) | 8 ( 40.0) | 0.095 | |
| AS_sk_parempi (%) | 0.538 | |||
| 0 | 3 ( 13.0) | 3 ( 15.0) | ||
| 0.5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 20 ( 87.0) | 16 ( 80.0) | ||
| AS_sk_kiintea = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_sk_kuivike (%) | 0.891 | |||
| 0 | 20 ( 87.0) | 18 ( 90.0) | ||
| 0.5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 2 ( 8.7) | 1 ( 5.0) | ||
| AS_sk_siisti = 1 (%) | 2 ( 8.7) | 1 ( 5.0) | 1.000 | |
| AS_sk_kuiva (%) | 0.364 | |||
| 0 | 22 ( 95.7) | 19 ( 95.0) | ||
| 0.5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_sk_syörauha = 1 (%) | 2 ( 8.7) | 3 ( 15.0) | 0.868 | |
| AS_sk_juorauha = 1 (%) | 2 ( 8.7) | 3 ( 15.0) | 0.868 | |
| AS_ruoklaite12345 = 4 (%) | 22 ( 95.7) | 19 ( 95.0) | 1.000 | |
| AS_ruokpaikka (%) | 0.402 | |||
| 0 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1 | 21 ( 91.3) | 20 (100.0) | ||
| 4 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_ruokpuht = 1 (%) | 2 ( 8.7) | 4 ( 20.0) | 0.531 | |
| AS_juomalaite123 = 1 (%) | 23 (100.0) | 19 ( 95.0) | 0.944 | |
| AS_juonalkm (%) | 0.364 | |||
| 0.222222222222222 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 22 ( 95.7) | 19 ( 95.0) | ||
| 2.25 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_juomapuht = 1 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| AS_juomatoim = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| AS_rauhallisuus123 = 1 (%) | 22 ( 95.7) | 19 ( 95.0) | 1.000 | |
| AS_hoitotarveKE = 2 (%) | 9 ( 39.1) | 10 ( 50.0) | 0.683 | |
| AS_stereo = 1 (%) | 4 ( 17.4) | 2 ( 10.0) | 0.798 | |
| TII_1ast_jout_samassa_2asteiole (%) | 0.401 | |||
| 0 | 19 ( 82.6) | 18 ( 90.0) | ||
| 1 | 2 ( 8.7) | 2 ( 10.0) | ||
| 2 | 2 ( 8.7) | 0 ( 0.0) | ||
| TII_valiseinat (%) | 0.440 | |||
| 0 | 22 ( 95.7) | 16 ( 80.0) | ||
| 0.5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 1 ( 4.3) | 1 ( 5.0) | ||
| 2.5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 16 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_meluton = 1 (%) | 18 ( 78.3) | 16 ( 80.0) | 1.000 | |
| TII_haittael_ei = 1 (%) | 19 ( 82.6) | 14 ( 70.0) | 0.539 | |
| TII_ilma_aistin = 1 (%) | 1 ( 4.3) | 4 ( 20.0) | 0.263 | |
| TII_ilma_amm = 1 (%) | 1 ( 4.3) | 5 ( 25.0) | 0.131 | |
| TII_ilma_pöly = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_ilma_muu = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_kosteus = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_valaistus = 1 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| TII_alusta12345 = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_latt_rakenne1234 (%) | 0.624 | |||
| 1 | 2 ( 8.7) | 3 ( 15.0) | ||
| 12 | 2 ( 8.7) | 2 ( 10.0) | ||
| 13 | 19 ( 82.6) | 14 ( 70.0) | ||
| 23 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_pr_ritila (%) | 0.217 | |||
| 0 | 22 ( 95.7) | 16 ( 80.0) | ||
| 20 | 1 ( 4.3) | 0 ( 0.0) | ||
| 28 | 0 ( 0.0) | 1 ( 5.0) | ||
| 40 | 0 ( 0.0) | 2 ( 10.0) | ||
| 50 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_pr_viemar = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_kuiv_mat12345 (%) | 0.508 | |||
| 1 | 4 ( 17.4) | 1 ( 5.0) | ||
| 2 | 15 ( 65.2) | 16 ( 80.0) | ||
| 12 | 1 ( 4.3) | 2 ( 10.0) | ||
| 14 | 2 ( 8.7) | 1 ( 5.0) | ||
| 15 | 1 ( 4.3) | 0 ( 0.0) | ||
| TII_kuiv_5_mika = 2 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| TII_maara1234 (%) | 0.669 | |||
| 1 | 3 ( 13.0) | 1 ( 5.0) | ||
| 2 | 2 ( 8.7) | 3 ( 15.0) | ||
| 3 | 14 ( 60.9) | 11 ( 55.0) | ||
| 4 | 4 ( 17.4) | 4 ( 20.0) | ||
| 23 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_tonkimat_6_mika (%) | 0.440 | |||
| 1 | 22 ( 95.7) | 16 ( 80.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 1 ( 4.3) | 1 ( 5.0) | ||
| TII_lelu1234 (%) | 0.257 | |||
| 2 | 2 ( 8.7) | 0 ( 0.0) | ||
| 4 | 21 ( 91.3) | 18 ( 90.0) | ||
| 5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 24 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_mat_vaiht = 1 (%) | 23 (100.0) | 19 ( 95.0) | 0.944 | |
| TII_maara123 (%) | 0.844 | |||
| 1 | 3 ( 13.0) | 1 ( 5.0) | ||
| 1.5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 2 | 18 ( 78.3) | 17 ( 85.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| TII_annostelu1234 (%) | 0.550 | |||
| 1 | 22 ( 95.7) | 18 ( 90.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4 | 1 ( 4.3) | 1 ( 5.0) | ||
| TII_lannanpoisto12 (%) | 0.168 | |||
| 1 | 15 ( 65.2) | 8 ( 40.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 1 ( 4.3) | 4 ( 20.0) | ||
| 4 | 1 ( 4.3) | 0 ( 0.0) | ||
| 5 | 5 ( 21.7) | 8 ( 40.0) | ||
| TII_rak_kunto = 1 (%) | 0 ( 0.0) | 2 ( 10.0) | 0.408 | |
| TII_latt_pitava = 1 (%) | 1 ( 4.3) | 2 ( 10.0) | 0.900 | |
| TII_sairkars = 1 (%) | 21 ( 91.3) | 18 ( 90.0) | 1.000 | |
| TII_ruok_0nonlock_1lock = 1 (%) | 11 ( 47.8) | 6 ( 30.0) | 0.379 | |
| TII_ruokpuht = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_juomalaite123 (%) | 0.364 | |||
| 1 | 22 ( 95.7) | 19 ( 95.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 12 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_juomapuht = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_juomatoim = 2 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| TII_rauhallisuus123 = 2 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| TII_hoitotarveKE = 2 (%) | 11 ( 47.8) | 11 ( 55.0) | 0.870 | |
| TII_stereo = 1 (%) | 2 ( 8.7) | 2 ( 10.0) | 1.000 | |
| POR_meluton = 1 (%) | 18 ( 78.3) | 15 ( 75.0) | 1.000 | |
| POR_haittael_ei = 1 (%) | 19 ( 82.6) | 18 ( 90.0) | 0.798 | |
| POR_haittael_laatu (%) | 0.383 | |||
| 1 | 15 ( 65.2) | 10 ( 50.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4 | 7 ( 30.4) | 9 ( 45.0) | ||
| POR_ilma_aistin = 1 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| POR_ilma_amm = 1 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| POR_ilma_pöly = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| POR_ilma_muu = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| POR_kosteus = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| POR_valaistus (%) | 0.234 | |||
| 0 | 21 ( 91.3) | 19 ( 95.0) | ||
| 0.5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 2 ( 8.7) | 0 ( 0.0) | ||
| POR_latt_rakenne1234 (%) | 0.387 | |||
| 1 | 2 ( 8.7) | 0 ( 0.0) | ||
| 2 | 2 ( 8.7) | 1 ( 5.0) | ||
| 12 | 18 ( 78.3) | 18 ( 90.0) | ||
| 13 | 0 ( 0.0) | 1 ( 5.0) | ||
| 123 | 1 ( 4.3) | 0 ( 0.0) | ||
| POR_pr_rako = 38 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| POR_maara1234 (%) | 0.020 | |||
| 2 | 1 ( 4.3) | 7 ( 35.0) | ||
| 3 | 17 ( 73.9) | 12 ( 60.0) | ||
| 4 | 5 ( 21.7) | 1 ( 5.0) | ||
| POR_tonkimat_6_mika (%) | 0.307 | |||
| 1 | 21 ( 91.3) | 15 ( 75.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4 | 1 ( 4.3) | 3 ( 15.0) | ||
| 5 | 0 ( 0.0) | 1 ( 5.0) | ||
| POR_lelu1234 (%) | 0.216 | |||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 2 ( 10.0) | ||
| 4 | 22 ( 95.7) | 17 ( 85.0) | ||
| 5 | 0 ( 0.0) | 1 ( 5.0) | ||
| POR_lelukomm (%) | 0.423 | |||
| 1 | 20 ( 87.0) | 20 (100.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| 4 | 1 ( 4.3) | 0 ( 0.0) | ||
| POR_mat_vaiht = 2 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| POR_maara123 (%) | 0.401 | |||
| 1 | 2 ( 8.7) | 0 ( 0.0) | ||
| 2 | 20 ( 87.0) | 19 ( 95.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| POR_annostelu1234 (%) | 0.763 | |||
| 1 | 19 ( 82.6) | 18 ( 90.0) | ||
| 2 | 2 ( 8.7) | 1 ( 5.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| 4 | 1 ( 4.3) | 0 ( 0.0) | ||
| POR_lannanpoisto12 = 2 (%) | 20 ( 87.0) | 19 ( 95.0) | 0.704 | |
| POR_rak_kunto = 1 (%) | 1 ( 4.3) | 2 ( 10.0) | 0.900 | |
| POR_latt_pitava = 1 (%) | 3 ( 13.0) | 0 ( 0.0) | 0.283 | |
| POR_sairkars (%) | 0.674 | |||
| 1 | 14 ( 60.9) | 15 ( 75.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 2 ( 8.7) | 2 ( 10.0) | ||
| 4 | 5 ( 21.7) | 3 ( 15.0) | ||
| 5 | 1 ( 4.3) | 0 ( 0.0) | ||
| POR_ruoklaite12345 (%) | 0.257 | |||
| 2 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2.5 | 21 ( 91.3) | 18 ( 90.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| 25 | 1 ( 4.3) | 0 ( 0.0) | ||
| POR_ruokpaikka = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| POR_ruokpuht = 1 (%) | 0 ( 0.0) | 3 ( 15.0) | 0.185 | |
| POR_juomalaite123 = 13 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| POR_juonalkm = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| POR_juomapuht = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| POR_juomatoim = 1 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| POR_rauhallisuus123 = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| Hajukarjut_per_emakko (%) | 0.560 | |||
| 0 | 3 ( 13.0) | 4 ( 20.0) | ||
| 0.01 | 13 ( 56.5) | 12 ( 60.0) | ||
| 0.02 | 3 ( 13.0) | 2 ( 10.0) | ||
| 0.03 | 4 ( 17.4) | 1 ( 5.0) | ||
| 0.06 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_VIRMaa_0_ei_1pellel_2pelvir_3niukuihiemnvir_4riirunkuiv (%) | 0.339 | |||
| 0 | 1 ( 4.3) | 3 ( 15.0) | ||
| 1 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2 | 4 ( 17.4) | 4 ( 20.0) | ||
| 3 | 6 ( 26.1) | 4 ( 20.0) | ||
| 4 | 12 ( 52.2) | 7 ( 35.0) | ||
| TII_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme (%) | 0.246 | |||
| 0 | 1 ( 4.3) | 3 ( 15.0) | ||
| 1 | 3 ( 13.0) | 6 ( 30.0) | ||
| 2 | 12 ( 52.2) | 6 ( 30.0) | ||
| 3 | 7 ( 30.4) | 5 ( 25.0) | ||
| AS_VIRMaa_0ei_1pellel_2pelvir_3niukuihiemvir_4riirunkuiv (%) | 0.019 | |||
| 0 | 4 ( 17.4) | 1 ( 5.0) | ||
| 1 | 0 ( 0.0) | 7 ( 35.0) | ||
| 2 | 12 ( 52.2) | 5 ( 25.0) | ||
| 3 | 4 ( 17.4) | 5 ( 25.0) | ||
| 4 | 3 ( 13.0) | 2 ( 10.0) | ||
| AS_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme (%) | 0.227 | |||
| 0 | 4 ( 17.4) | 1 ( 5.0) | ||
| 1 | 9 ( 39.1) | 13 ( 65.0) | ||
| 2 | 6 ( 26.1) | 2 ( 10.0) | ||
| 3 | 4 ( 17.4) | 4 ( 20.0) | ||
| POR_VIRMaa_0_ei_1pellel_2pelvir_3niukui_4riikuiv (%) | 0.194 | |||
| 0 | 2 ( 8.7) | 1 ( 5.0) | ||
| 1 | 1 ( 4.3) | 2 ( 10.0) | ||
| 2 | 7 ( 30.4) | 2 ( 10.0) | ||
| 3 | 10 ( 43.5) | 7 ( 35.0) | ||
| 4 | 3 ( 13.0) | 8 ( 40.0) | ||
| POR_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme (%) | 0.851 | |||
| 0 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 6 ( 26.1) | 3 ( 15.0) | ||
| 2 | 14 ( 60.9) | 14 ( 70.0) | ||
| 3 | 2 ( 8.7) | 2 ( 10.0) | ||
| Koulmax_1peru_2ops_3a_4amk_5yl (%) | 0.613 | |||
| 2 | 3 ( 13.0) | 2 ( 10.0) | ||
| 3 | 15 ( 65.2) | 13 ( 65.0) | ||
| 4 | 4 ( 17.4) | 2 ( 10.0) | ||
| 5 | 1 ( 4.3) | 3 ( 15.0) | ||
| Stressi_1erpal_4jnkv (%) | 0.846 | |||
| 1 | 4 ( 17.4) | 2 ( 10.0) | ||
| 2 | 4 ( 17.4) | 4 ( 20.0) | ||
| 3 | 8 ( 34.8) | 6 ( 30.0) | ||
| 4 | 7 ( 30.4) | 8 ( 40.0) | ||
| EMKUOLLJAKO = 1 (%) | 0 ( 0.0) | 20 (100.0) | <0.001 | |
| EMPOISJAKO = 1 (%) | 5 ( 21.7) | 14 ( 70.0) | 0.004 | |
| EMENKUOLLJAKO = 1 (%) | 1 ( 4.3) | 17 ( 85.0) | <0.001 | |
| EMENPOISJAKO = 1 (%) | 3 ( 13.0) | 13 ( 65.0) | 0.001 | |
| NIVEL_01 = 2 (%) | 8 ( 34.8) | 10 ( 50.0) | 0.485 | |
| PAISE_01 = 2 (%) | 8 ( 34.8) | 10 ( 50.0) | 0.485 | |
| MAKUU01 = 2 (%) | 7 ( 30.4) | 11 ( 55.0) | 0.187 | |
| KOKO_01 = 2 (%) | 7 ( 30.4) | 11 ( 55.0) | 0.187 | |
| OSA_01 = 2 (%) | 9 ( 39.1) | 9 ( 45.0) | 0.937 | |
| JOKUHYLK_01 = 2 (%) | 6 ( 26.1) | 12 ( 60.0) | 0.053 | |
| PLEUR_01 = 1 (%) | 4 ( 17.4) | 8 ( 40.0) | 0.191 | |
| PNEUM_01 = 2 (%) | 7 ( 30.4) | 11 ( 55.0) | 0.187 | |
| SAIRKARS_AST_TII = 1 (%) | 15 ( 65.2) | 18 ( 90.0) | 0.120 | |
| EMKUOL (mean (sd)) | 0.00 (0.00) | 1.00 (0.00) | <0.001 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
tilatkat2<-tilatkat
tilatkat2$EMPOIS<-tilat$EMPOISJAKO
table2 = KreateTableOne(x=tilatkat2, strata='EMPOIS')
table2%>%
kable("html", align = "rrr", caption = "Data variable summary strat by EMPOIS") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 24 | 19 | ||
| Haastrooli_1OmEiosall_2OmOsall_3Esimies (%) | 0.311 | |||
| 1 | 4 ( 16.7) | 6 ( 31.6) | ||
| 2 | 18 ( 75.0) | 10 ( 52.6) | ||
| 3 | 2 ( 8.3) | 3 ( 15.8) | ||
| Tuotsuunta = 2 (%) | 13 ( 54.2) | 8 ( 42.1) | 0.632 | |
| Karjut_astsiem (%) | 0.245 | |||
| 0 | 22 ( 91.7) | 16 ( 84.2) | ||
| 1 | 1 ( 4.2) | 0 ( 0.0) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 6 | 0 ( 0.0) | 2 ( 10.5) | ||
| Tautsu = 1 (%) | 15 ( 62.5) | 15 ( 78.9) | 0.405 | |
| Tautsuok = 1 (%) | 9 ( 37.5) | 12 ( 63.2) | 0.172 | |
| Tautsu_012 (%) | 0.473 | |||
| 0 | 9 ( 37.5) | 4 ( 21.1) | ||
| 1 | 7 ( 29.2) | 6 ( 31.6) | ||
| 2 | 8 ( 33.3) | 9 ( 47.4) | ||
| Siilotkat = 1 (%) | 22 ( 91.7) | 17 ( 89.5) | 1.000 | |
| Tuhoei = 1 (%) | 20 ( 83.3) | 15 ( 78.9) | 1.000 | |
| Eikulkuih = 1 (%) | 16 ( 66.7) | 11 ( 57.9) | 0.785 | |
| Eikulkuel = 1 (%) | 17 ( 70.8) | 13 ( 68.4) | 1.000 | |
| Suojvar = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| Suojvarpuh = 1 (%) | 23 ( 95.8) | 19 (100.0) | 1.000 | |
| Kadetpesu = 1 (%) | 16 ( 66.7) | 14 ( 73.7) | 0.870 | |
| Toimsiis = 1 (%) | 23 ( 95.8) | 18 ( 94.7) | 1.000 | |
| Saappesu = 1 (%) | 18 ( 75.0) | 13 ( 68.4) | 0.892 | |
| Lasthu = 1 (%) | 19 ( 79.2) | 17 ( 89.5) | 0.622 | |
| Teurkuski_0paaseesikalaan_1eipaase = 1 (%) | 18 ( 75.0) | 12 ( 63.2) | 0.613 | |
| JOU_kertayt_0ei = 1 (%) | 4 ( 16.7) | 3 ( 15.8) | 1.000 | |
| JOU_tuotvaiherill_0ei = 1 (%) | 18 ( 75.0) | 13 ( 68.4) | 0.892 | |
| JOU_pesu_0ei = 1 (%) | 4 ( 16.7) | 2 ( 10.5) | 0.893 | |
| JOU_pesuaine_0ei = 1 (%) | 3 ( 12.5) | 1 ( 5.3) | 0.777 | |
| JOU_desinf_liu_0ei_1liuos_2kuiva (%) | 0.709 | |||
| 0 | 22 ( 91.7) | 16 ( 84.2) | ||
| 1 | 0 ( 0.0) | 1 ( 5.3) | ||
| 2 | 1 ( 4.2) | 1 ( 5.3) | ||
| 12 | 1 ( 4.2) | 1 ( 5.3) | ||
| JOU_tyhjana_mi1vrk_0ei = 1 (%) | 9 ( 37.5) | 4 ( 21.1) | 0.405 | |
| PORSOSASTO_kertayt_0ei = 1 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| PORS_tuotvaiherill_0ei = 1 (%) | 17 ( 70.8) | 16 ( 84.2) | 0.504 | |
| PORS_pesu_0ei = 1 (%) | 20 ( 83.3) | 13 ( 68.4) | 0.432 | |
| PORS_pesuaine_0ei = 1 (%) | 5 ( 20.8) | 5 ( 26.3) | 0.953 | |
| PORS_desinf_0ei_1LIU_2KUIVA (%) | 0.894 | |||
| 0 | 4 ( 16.7) | 5 ( 26.3) | ||
| 1 | 11 ( 45.8) | 8 ( 42.1) | ||
| 2 | 6 ( 25.0) | 4 ( 21.1) | ||
| 12 | 3 ( 12.5) | 2 ( 10.5) | ||
| PORS_tyhjana_mi1vr_0ei = 1 (%) | 14 ( 58.3) | 12 ( 63.2) | 0.994 | |
| Raa_0ei_1kontti_2huone (%) | 0.844 | |||
| 0 | 1 ( 4.2) | 2 ( 10.5) | ||
| 1 | 20 ( 83.3) | 14 ( 73.7) | ||
| 2 | 1 ( 4.2) | 1 ( 5.3) | ||
| 12 | 2 ( 8.3) | 2 ( 10.5) | ||
| Raa_auto_hakee_0ei = 1 (%) | 17 ( 70.8) | 10 ( 52.6) | 0.364 | |
| Raa_viilea_0ei = 1 (%) | 22 ( 91.7) | 16 ( 84.2) | 0.781 | |
| Raa_tuhoelain_1eipaase_0paaseesic = 1 (%) | 15 ( 62.5) | 11 ( 57.9) | 1.000 | |
| Tuhoelmerkkeja_0kylla_1ei = 1 (%) | 6 ( 25.0) | 4 ( 21.1) | 1.000 | |
| Lintuja_0kylla_1ei = 1 (%) | 19 ( 79.2) | 14 ( 73.7) | 0.953 | |
| Tuho_ohjelma = 1 (%) | 2 ( 8.3) | 3 ( 15.8) | 0.781 | |
| kissoja0on1ei (%) | 0.051 | |||
| 0 | 18 ( 75.0) | 8 ( 42.1) | ||
| 0.5 | 0 ( 0.0) | 2 ( 10.5) | ||
| 1 | 6 ( 25.0) | 9 ( 47.4) | ||
| Kotielain_sikalaan_0kylla_1ei = 1 (%) | 20 ( 83.3) | 14 ( 73.7) | 0.693 | |
| Vesi_1kunn_0oma = 1 (%) | 15 ( 62.5) | 12 ( 63.2) | 1.000 | |
| Ery = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| Parvo = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| Koli = 1 (%) | 23 ( 95.8) | 18 ( 94.7) | 1.000 | |
| Sirko = 1 (%) | 8 ( 33.3) | 5 ( 26.3) | 0.870 | |
| ClC = 1 (%) | 1 ( 4.2) | 2 ( 10.5) | 0.833 | |
| ClA = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| SI = 1 (%) | 1 ( 4.2) | 3 ( 15.8) | 0.439 | |
| APP = 1 (%) | 4 ( 16.7) | 1 ( 5.3) | 0.497 | |
| Loisaika_1ennenpors_2_porskars = 2 (%) | 8 ( 33.3) | 8 ( 42.1) | 0.785 | |
| Uusiryh (%) | 0.597 | |||
| 1 | 2 ( 8.3) | 1 ( 5.3) | ||
| 2 | 20 ( 83.3) | 18 ( 94.7) | ||
| 3 | 1 ( 4.2) | 0 ( 0.0) | ||
| 4 | 1 ( 4.2) | 0 ( 0.0) | ||
| Ton_tiheys_1aina_2jaetaan = 2 (%) | 3 ( 12.5) | 1 ( 5.3) | 0.777 | |
| Yhdistaggrtmp_1eiongelma_2tmp_3eitmp (%) | 0.591 | |||
| 1 | 4 ( 16.7) | 1 ( 5.3) | ||
| 2 | 11 ( 45.8) | 11 ( 57.9) | ||
| 3 | 4 ( 16.7) | 2 ( 10.5) | ||
| 12 | 5 ( 20.8) | 5 ( 26.3) | ||
| Muutelkaynn_0ei_1_satunn_2kaynnmuusaann (%) | 0.089 | |||
| 0 | 11 ( 45.8) | 5 ( 26.3) | ||
| 1 | 12 ( 50.0) | 9 ( 47.4) | ||
| 2 | 1 ( 4.2) | 5 ( 26.3) | ||
| maitokuume = 1 (%) | 12 ( 50.0) | 10 ( 52.6) | 1.000 | |
| metriitti = 1 (%) | 10 ( 41.7) | 9 ( 47.4) | 0.948 | |
| valuttelu = 1 (%) | 3 ( 12.5) | 2 ( 10.5) | 1.000 | |
| mastiitti = 1 (%) | 5 ( 20.8) | 5 ( 26.3) | 0.953 | |
| ontuma = 1 (%) | 15 ( 62.5) | 16 ( 84.2) | 0.217 | |
| syomattomyys = 1 (%) | 14 ( 58.3) | 8 ( 42.1) | 0.453 | |
| kuume = 1 (%) | 5 ( 20.8) | 1 ( 5.3) | 0.308 | |
| loukkaantuminen = 1 (%) | 11 ( 45.8) | 5 ( 26.3) | 0.319 | |
| AB_rutiinilaak = 1 (%) | 3 ( 12.5) | 3 ( 15.8) | 1.000 | |
| Oksitosiini_rutiinisti = 1 (%) | 7 ( 29.2) | 10 ( 52.6) | 0.212 | |
| Kaynnistys_rutiinisti = 1 (%) | 0 ( 0.0) | 4 ( 21.1) | 0.067 | |
| NSAID_porsituksessa_rutiini = 1 (%) | 6 ( 25.0) | 4 ( 21.1) | 1.000 | |
| OMATENSIKOT_0EI_1KYLLa = 1 (%) | 15 ( 62.5) | 13 ( 68.4) | 0.934 | |
| Ensikk_valisiirtkars_ennensiem = 1 (%) | 8 ( 33.3) | 9 ( 47.4) | 0.535 | |
| Ensikk_kiihruok = 1 (%) | 9 ( 37.5) | 7 ( 36.8) | 1.000 | |
| Ensikk_karjukontaktiensi_0hajutainako_1aidanlapi_2kars (%) | 0.431 | |||
| 0 | 2 ( 8.3) | 2 ( 10.5) | ||
| 1 | 20 ( 83.3) | 17 ( 89.5) | ||
| 2 | 2 ( 8.3) | 0 ( 0.0) | ||
| siemika (%) | 0.161 | |||
| 7 | 1 ( 4.2) | 0 ( 0.0) | ||
| 7.5 | 0 ( 0.0) | 2 ( 10.5) | ||
| 8 | 20 ( 83.3) | 14 ( 73.7) | ||
| 8.5 | 1 ( 4.2) | 3 ( 15.8) | ||
| 9.5 | 2 ( 8.3) | 0 ( 0.0) | ||
| Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk (%) | 0.828 | |||
| 1 | 1 ( 4.2) | 0 ( 0.0) | ||
| 2 | 3 ( 12.5) | 2 ( 10.5) | ||
| 3 | 19 ( 79.2) | 16 ( 84.2) | ||
| 4 | 1 ( 4.2) | 1 ( 5.3) | ||
| Kiimantark_ryhmakaytt = 1 (%) | 21 ( 87.5) | 17 ( 89.5) | 1.000 | |
| Kiimantarkalkaa_vrkvier (%) | 0.224 | |||
| 0 | 5 ( 20.8) | 7 ( 36.8) | ||
| 1 | 16 ( 66.7) | 7 ( 36.8) | ||
| 3 | 2 ( 8.3) | 1 ( 5.3) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| 5 | 1 ( 4.2) | 3 ( 15.8) | ||
| Kiimamerk_emakonselka = 1 (%) | 18 ( 75.0) | 19 (100.0) | 0.057 | |
| Kiimantark_postsiem = 1 (%) | 23 ( 95.8) | 18 ( 94.7) | 1.000 | |
| Postsiem_ryhmakaytt_havainnointi = 1 (%) | 21 ( 87.5) | 17 ( 89.5) | 1.000 | |
| Tiin_ultra2 (%) | 0.266 | |||
| 6 | 24 (100.0) | 17 ( 89.5) | ||
| 8 | 0 ( 0.0) | 1 ( 5.3) | ||
| 10 | 0 ( 0.0) | 1 ( 5.3) | ||
| Tiin_ultra_1yhdesti_2kahdesti (%) | 0.098 | |||
| 0 | 6 ( 25.0) | 1 ( 5.3) | ||
| 1 | 16 ( 66.7) | 13 ( 68.4) | ||
| 2 | 2 ( 8.3) | 5 ( 26.3) | ||
| Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen (%) | 0.085 | |||
| 0 | 10 ( 41.7) | 6 ( 31.6) | ||
| 1 | 0 ( 0.0) | 2 ( 10.5) | ||
| 2 | 2 ( 8.3) | 6 ( 31.6) | ||
| 3 | 2 ( 8.3) | 0 ( 0.0) | ||
| 4 | 10 ( 41.7) | 5 ( 26.3) | ||
| Pesantekomatmaara_1runsas_2jnkv_3niukka (%) | 0.269 | |||
| 1 | 3 ( 12.5) | 0 ( 0.0) | ||
| 2 | 17 ( 70.8) | 16 ( 84.2) | ||
| 3 | 4 ( 16.7) | 3 ( 15.8) | ||
| Sisatutk_ennenoksitos = 1 (%) | 10 ( 41.7) | 5 ( 26.3) | 0.467 | |
| Porsitusaputekn_1empesu_2kaspesu_3kasine_4liukaste (%) | 0.532 | |||
| 34 | 10 ( 41.7) | 5 ( 26.3) | ||
| 124 | 1 ( 4.2) | 1 ( 5.3) | ||
| 134 | 7 ( 29.2) | 10 ( 52.6) | ||
| 234 | 1 ( 4.2) | 0 ( 0.0) | ||
| 1234 | 5 ( 20.8) | 3 ( 15.8) | ||
| PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa = 2 (%) | 20 ( 83.3) | 15 ( 78.9) | 1.000 | |
| Ruoksu_0ei_1itse_2neuvoja_3kyllaeitietoa (%) | 0.445 | |||
| 1 | 1 ( 4.2) | 1 ( 5.3) | ||
| 2 | 21 ( 87.5) | 13 ( 68.4) | ||
| 3 | 1 ( 4.2) | 2 ( 10.5) | ||
| 12 | 1 ( 4.2) | 3 ( 15.8) | ||
| Yksilöll_ruokinta = 1 (%) | 16 ( 66.7) | 15 ( 78.9) | 0.583 | |
| AS_1ast_jout_samassa_2asteiole = 2 (%) | 21 ( 87.5) | 15 ( 78.9) | 0.735 | |
| AS_er_os_lkm = 2 (%) | 3 ( 12.5) | 1 ( 5.3) | 0.777 | |
| AS_em_kars (%) | 0.391 | |||
| 2.5 | 1 ( 4.2) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.3) | ||
| 7.5 | 22 ( 91.7) | 17 ( 89.5) | ||
| 8 | 0 ( 0.0) | 1 ( 5.3) | ||
| 60 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_karspit (%) | 0.448 | |||
| 3.31 | 1 ( 4.2) | 0 ( 0.0) | ||
| 4.4 | 1 ( 4.2) | 0 ( 0.0) | ||
| 5.94 | 21 ( 87.5) | 18 ( 94.7) | ||
| 7 | 0 ( 0.0) | 1 ( 5.3) | ||
| 20 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_karslev (%) | 0.448 | |||
| 2.67 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3.02 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4.8 | 21 ( 87.5) | 18 ( 94.7) | ||
| 6.8 | 1 ( 4.2) | 0 ( 0.0) | ||
| 7 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_meluton = 1 (%) | 21 ( 87.5) | 18 ( 94.7) | 0.777 | |
| AS_haittael_ei = 1 (%) | 21 ( 87.5) | 16 ( 84.2) | 1.000 | |
| AS_haittael_laatu (%) | 0.246 | |||
| 1 | 16 ( 66.7) | 10 ( 52.6) | ||
| 2 | 0 ( 0.0) | 2 ( 10.5) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4 | 8 ( 33.3) | 6 ( 31.6) | ||
| AS_ilma_aistin = 1 (%) | 4 ( 16.7) | 4 ( 21.1) | 1.000 | |
| AS_ilma_amm = 1 (%) | 4 ( 16.7) | 4 ( 21.1) | 1.000 | |
| AS_ilma_pöly = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_ilma_muu = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_kosteus = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_valaistus = 1 (%) | 1 ( 4.2) | 1 ( 5.3) | 1.000 | |
| AS_alusta12345 = 12 (%) | 3 ( 12.5) | 4 ( 21.1) | 0.735 | |
| AS_alusta_5_laatu = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_latt_rakenne1234 = 13 (%) | 21 ( 87.5) | 15 ( 78.9) | 0.735 | |
| AS_pr_ritila (%) | 0.594 | |||
| 0 | 21 ( 87.5) | 15 ( 78.9) | ||
| 20 | 1 ( 4.2) | 2 ( 10.5) | ||
| 25 | 1 ( 4.2) | 1 ( 5.3) | ||
| 33 | 0 ( 0.0) | 1 ( 5.3) | ||
| 41 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_pr_viemar = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_kuiv_mat12345 (%) | 0.315 | |||
| 1 | 3 ( 12.5) | 1 ( 5.3) | ||
| 1.5 | 19 ( 79.2) | 16 ( 84.2) | ||
| 2 | 0 ( 0.0) | 2 ( 10.5) | ||
| 12 | 1 ( 4.2) | 0 ( 0.0) | ||
| 14 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_kuiv_5_mika (%) | 0.513 | |||
| 0 | 1 ( 4.2) | 1 ( 5.3) | ||
| 3 | 23 ( 95.8) | 17 ( 89.5) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| AS_maara1234 (%) | 0.633 | |||
| 0 | 1 ( 4.2) | 0 ( 0.0) | ||
| 1 | 1 ( 4.2) | 0 ( 0.0) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 2 ( 8.3) | 2 ( 10.5) | ||
| 4 | 19 ( 79.2) | 17 ( 89.5) | ||
| AS_tonkimat123456 (%) | 0.358 | |||
| 1 | 23 ( 95.8) | 18 ( 94.7) | ||
| 5 | 0 ( 0.0) | 1 ( 5.3) | ||
| 12 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_tonkimat_6_mika = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_mat_vaiht = 1 (%) | 22 ( 91.7) | 19 (100.0) | 0.576 | |
| AS_maara123 (%) | 0.320 | |||
| 0 | 1 ( 4.2) | 0 ( 0.0) | ||
| 2 | 19 ( 79.2) | 18 ( 94.7) | ||
| 3 | 4 ( 16.7) | 1 ( 5.3) | ||
| AS_annostelu1234 (%) | 0.660 | |||
| 0 | 1 ( 4.2) | 1 ( 5.3) | ||
| 1 | 22 ( 91.7) | 18 ( 94.7) | ||
| 3 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_lannanpoisto12 (%) | 0.531 | |||
| 0 | 1 ( 4.2) | 0 ( 0.0) | ||
| 1 | 1 ( 4.2) | 2 ( 10.5) | ||
| 2 | 21 ( 87.5) | 17 ( 89.5) | ||
| 12 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_rak_kunto = 1 (%) | 1 ( 4.2) | 0 ( 0.0) | 1.000 | |
| AS_latt_pitava = 1 (%) | 1 ( 4.2) | 0 ( 0.0) | 1.000 | |
| AS_sairkars = 1 (%) | 6 ( 25.0) | 5 ( 26.3) | 1.000 | |
| AS_sk_parempi (%) | 0.461 | |||
| 0 | 4 ( 16.7) | 2 ( 10.5) | ||
| 0.5 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 20 ( 83.3) | 16 ( 84.2) | ||
| AS_sk_kiintea = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_sk_kuivike (%) | 0.916 | |||
| 0 | 21 ( 87.5) | 17 ( 89.5) | ||
| 0.5 | 1 ( 4.2) | 1 ( 5.3) | ||
| 1 | 2 ( 8.3) | 1 ( 5.3) | ||
| AS_sk_siisti = 1 (%) | 2 ( 8.3) | 1 ( 5.3) | 1.000 | |
| AS_sk_kuiva (%) | 0.358 | |||
| 0 | 23 ( 95.8) | 18 ( 94.7) | ||
| 0.5 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_sk_syörauha = 1 (%) | 1 ( 4.2) | 4 ( 21.1) | 0.216 | |
| AS_sk_juorauha = 1 (%) | 1 ( 4.2) | 4 ( 21.1) | 0.216 | |
| AS_ruoklaite12345 = 4 (%) | 24 (100.0) | 17 ( 89.5) | 0.369 | |
| AS_ruokpaikka (%) | 0.266 | |||
| 0 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 24 (100.0) | 17 ( 89.5) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| AS_ruokpuht = 1 (%) | 3 ( 12.5) | 3 ( 15.8) | 1.000 | |
| AS_juomalaite123 = 1 (%) | 23 ( 95.8) | 19 (100.0) | 1.000 | |
| AS_juonalkm (%) | 0.358 | |||
| 0.222222222222222 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 23 ( 95.8) | 18 ( 94.7) | ||
| 2.25 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_juomapuht = 1 (%) | 1 ( 4.2) | 0 ( 0.0) | 1.000 | |
| AS_juomatoim = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| AS_rauhallisuus123 = 1 (%) | 22 ( 91.7) | 19 (100.0) | 0.576 | |
| AS_hoitotarveKE = 2 (%) | 10 ( 41.7) | 9 ( 47.4) | 0.948 | |
| AS_stereo = 1 (%) | 4 ( 16.7) | 2 ( 10.5) | 0.893 | |
| TII_1ast_jout_samassa_2asteiole (%) | 0.953 | |||
| 0 | 21 ( 87.5) | 16 ( 84.2) | ||
| 1 | 2 ( 8.3) | 2 ( 10.5) | ||
| 2 | 1 ( 4.2) | 1 ( 5.3) | ||
| TII_valiseinat (%) | 0.491 | |||
| 0 | 22 ( 91.7) | 16 ( 84.2) | ||
| 0.5 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 1 ( 4.2) | 1 ( 5.3) | ||
| 2.5 | 1 ( 4.2) | 0 ( 0.0) | ||
| 16 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_meluton = 1 (%) | 17 ( 70.8) | 17 ( 89.5) | 0.265 | |
| TII_haittael_ei = 1 (%) | 19 ( 79.2) | 14 ( 73.7) | 0.953 | |
| TII_ilma_aistin = 1 (%) | 2 ( 8.3) | 3 ( 15.8) | 0.781 | |
| TII_ilma_amm = 1 (%) | 3 ( 12.5) | 3 ( 15.8) | 1.000 | |
| TII_ilma_pöly = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_ilma_muu = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_kosteus = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_valaistus = 1 (%) | 1 ( 4.2) | 0 ( 0.0) | 1.000 | |
| TII_alusta12345 = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_latt_rakenne1234 (%) | 0.471 | |||
| 1 | 4 ( 16.7) | 1 ( 5.3) | ||
| 12 | 2 ( 8.3) | 2 ( 10.5) | ||
| 13 | 18 ( 75.0) | 15 ( 78.9) | ||
| 23 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_pr_ritila (%) | 0.491 | |||
| 0 | 22 ( 91.7) | 16 ( 84.2) | ||
| 20 | 1 ( 4.2) | 0 ( 0.0) | ||
| 28 | 0 ( 0.0) | 1 ( 5.3) | ||
| 40 | 1 ( 4.2) | 1 ( 5.3) | ||
| 50 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_pr_viemar = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_kuiv_mat12345 (%) | 0.565 | |||
| 1 | 4 ( 16.7) | 1 ( 5.3) | ||
| 2 | 15 ( 62.5) | 16 ( 84.2) | ||
| 12 | 2 ( 8.3) | 1 ( 5.3) | ||
| 14 | 2 ( 8.3) | 1 ( 5.3) | ||
| 15 | 1 ( 4.2) | 0 ( 0.0) | ||
| TII_kuiv_5_mika = 2 (%) | 1 ( 4.2) | 0 ( 0.0) | 1.000 | |
| TII_maara1234 (%) | 0.508 | |||
| 1 | 3 ( 12.5) | 1 ( 5.3) | ||
| 2 | 4 ( 16.7) | 1 ( 5.3) | ||
| 3 | 13 ( 54.2) | 12 ( 63.2) | ||
| 4 | 4 ( 16.7) | 4 ( 21.1) | ||
| 23 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_tonkimat_6_mika (%) | 0.186 | |||
| 1 | 23 ( 95.8) | 15 ( 78.9) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| 5 | 0 ( 0.0) | 2 ( 10.5) | ||
| TII_lelu1234 (%) | 0.296 | |||
| 2 | 2 ( 8.3) | 0 ( 0.0) | ||
| 4 | 21 ( 87.5) | 18 ( 94.7) | ||
| 5 | 1 ( 4.2) | 0 ( 0.0) | ||
| 24 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_mat_vaiht = 1 (%) | 24 (100.0) | 18 ( 94.7) | 0.906 | |
| TII_maara123 (%) | 0.877 | |||
| 1 | 3 ( 12.5) | 1 ( 5.3) | ||
| 1.5 | 1 ( 4.2) | 1 ( 5.3) | ||
| 2 | 19 ( 79.2) | 16 ( 84.2) | ||
| 3 | 1 ( 4.2) | 1 ( 5.3) | ||
| TII_annostelu1234 (%) | 0.513 | |||
| 1 | 23 ( 95.8) | 17 ( 89.5) | ||
| 2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4 | 1 ( 4.2) | 1 ( 5.3) | ||
| TII_lannanpoisto12 (%) | 0.486 | |||
| 1 | 14 ( 58.3) | 9 ( 47.4) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 3 ( 12.5) | 2 ( 10.5) | ||
| 4 | 1 ( 4.2) | 0 ( 0.0) | ||
| 5 | 5 ( 20.8) | 8 ( 42.1) | ||
| TII_rak_kunto = 1 (%) | 1 ( 4.2) | 1 ( 5.3) | 1.000 | |
| TII_latt_pitava = 1 (%) | 1 ( 4.2) | 2 ( 10.5) | 0.833 | |
| TII_sairkars = 1 (%) | 23 ( 95.8) | 16 ( 84.2) | 0.439 | |
| TII_ruok_0nonlock_1lock = 1 (%) | 12 ( 50.0) | 5 ( 26.3) | 0.206 | |
| TII_ruokpuht = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_juomalaite123 (%) | 0.358 | |||
| 1 | 23 ( 95.8) | 18 ( 94.7) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 12 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_juomapuht = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_juomatoim = 2 (%) | 0 ( 0.0) | 1 ( 5.3) | 0.906 | |
| TII_rauhallisuus123 = 2 (%) | 0 ( 0.0) | 1 ( 5.3) | 0.906 | |
| TII_hoitotarveKE = 2 (%) | 12 ( 50.0) | 10 ( 52.6) | 1.000 | |
| TII_stereo = 1 (%) | 2 ( 8.3) | 2 ( 10.5) | 1.000 | |
| POR_meluton = 1 (%) | 21 ( 87.5) | 12 ( 63.2) | 0.130 | |
| POR_haittael_ei = 1 (%) | 21 ( 87.5) | 16 ( 84.2) | 1.000 | |
| POR_haittael_laatu (%) | 0.561 | |||
| 1 | 14 ( 58.3) | 11 ( 57.9) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4 | 9 ( 37.5) | 7 ( 36.8) | ||
| POR_ilma_aistin = 1 (%) | 1 ( 4.2) | 0 ( 0.0) | 1.000 | |
| POR_ilma_amm = 1 (%) | 1 ( 4.2) | 0 ( 0.0) | 1.000 | |
| POR_ilma_pöly = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| POR_ilma_muu = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| POR_kosteus = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| POR_valaistus (%) | 0.660 | |||
| 0 | 22 ( 91.7) | 18 ( 94.7) | ||
| 0.5 | 1 ( 4.2) | 0 ( 0.0) | ||
| 1 | 1 ( 4.2) | 1 ( 5.3) | ||
| POR_latt_rakenne1234 (%) | 0.164 | |||
| 1 | 2 ( 8.3) | 0 ( 0.0) | ||
| 2 | 3 ( 12.5) | 0 ( 0.0) | ||
| 12 | 18 ( 75.0) | 18 ( 94.7) | ||
| 13 | 0 ( 0.0) | 1 ( 5.3) | ||
| 123 | 1 ( 4.2) | 0 ( 0.0) | ||
| POR_pr_rako = 38 (%) | 0 ( 0.0) | 1 ( 5.3) | 0.906 | |
| POR_maara1234 (%) | 0.265 | |||
| 2 | 5 ( 20.8) | 3 ( 15.8) | ||
| 3 | 14 ( 58.3) | 15 ( 78.9) | ||
| 4 | 5 ( 20.8) | 1 ( 5.3) | ||
| POR_tonkimat_6_mika (%) | 0.081 | |||
| 1 | 22 ( 91.7) | 14 ( 73.7) | ||
| 2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 3 | 1 ( 4.2) | 0 ( 0.0) | ||
| 4 | 0 ( 0.0) | 4 ( 21.1) | ||
| 5 | 1 ( 4.2) | 0 ( 0.0) | ||
| POR_lelu1234 (%) | 0.643 | |||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 1 ( 4.2) | 1 ( 5.3) | ||
| 4 | 21 ( 87.5) | 18 ( 94.7) | ||
| 5 | 1 ( 4.2) | 0 ( 0.0) | ||
| POR_lelukomm (%) | 0.414 | |||
| 1 | 22 ( 91.7) | 18 ( 94.7) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4 | 1 ( 4.2) | 0 ( 0.0) | ||
| POR_mat_vaiht = 2 (%) | 0 ( 0.0) | 1 ( 5.3) | 0.906 | |
| POR_maara123 (%) | 0.433 | |||
| 1 | 2 ( 8.3) | 0 ( 0.0) | ||
| 2 | 21 ( 87.5) | 18 ( 94.7) | ||
| 3 | 1 ( 4.2) | 1 ( 5.3) | ||
| POR_annostelu1234 (%) | 0.386 | |||
| 1 | 20 ( 83.3) | 17 ( 89.5) | ||
| 2 | 2 ( 8.3) | 1 ( 5.3) | ||
| 3 | 2 ( 8.3) | 0 ( 0.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| POR_lannanpoisto12 = 2 (%) | 21 ( 87.5) | 18 ( 94.7) | 0.777 | |
| POR_rak_kunto = 1 (%) | 2 ( 8.3) | 1 ( 5.3) | 1.000 | |
| POR_latt_pitava = 1 (%) | 3 ( 12.5) | 0 ( 0.0) | 0.320 | |
| POR_sairkars (%) | 0.679 | |||
| 1 | 17 ( 70.8) | 12 ( 63.2) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 2 ( 8.3) | 2 ( 10.5) | ||
| 4 | 4 ( 16.7) | 4 ( 21.1) | ||
| 5 | 0 ( 0.0) | 1 ( 5.3) | ||
| POR_ruoklaite12345 (%) | 0.554 | |||
| 2 | 1 ( 4.2) | 1 ( 5.3) | ||
| 2.5 | 22 ( 91.7) | 17 ( 89.5) | ||
| 3 | 1 ( 4.2) | 0 ( 0.0) | ||
| 25 | 0 ( 0.0) | 1 ( 5.3) | ||
| POR_ruokpaikka = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| POR_ruokpuht = 1 (%) | 2 ( 8.3) | 1 ( 5.3) | 1.000 | |
| POR_juomalaite123 = 13 (%) | 0 ( 0.0) | 1 ( 5.3) | 0.906 | |
| POR_juonalkm = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| POR_juomapuht = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| POR_juomatoim = 1 (%) | 0 ( 0.0) | 1 ( 5.3) | 0.906 | |
| POR_rauhallisuus123 = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| Hajukarjut_per_emakko (%) | 0.564 | |||
| 0 | 3 ( 12.5) | 4 ( 21.1) | ||
| 0.01 | 14 ( 58.3) | 11 ( 57.9) | ||
| 0.02 | 4 ( 16.7) | 1 ( 5.3) | ||
| 0.03 | 3 ( 12.5) | 2 ( 10.5) | ||
| 0.06 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_VIRMaa_0_ei_1pellel_2pelvir_3niukuihiemnvir_4riirunkuiv (%) | 0.148 | |||
| 0 | 1 ( 4.2) | 3 ( 15.8) | ||
| 1 | 0 ( 0.0) | 2 ( 10.5) | ||
| 2 | 4 ( 16.7) | 4 ( 21.1) | ||
| 3 | 5 ( 20.8) | 5 ( 26.3) | ||
| 4 | 14 ( 58.3) | 5 ( 26.3) | ||
| TII_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme (%) | 0.214 | |||
| 0 | 1 ( 4.2) | 3 ( 15.8) | ||
| 1 | 5 ( 20.8) | 4 ( 21.1) | ||
| 2 | 13 ( 54.2) | 5 ( 26.3) | ||
| 3 | 5 ( 20.8) | 7 ( 36.8) | ||
| AS_VIRMaa_0ei_1pellel_2pelvir_3niukuihiemvir_4riirunkuiv (%) | 0.052 | |||
| 0 | 5 ( 20.8) | 0 ( 0.0) | ||
| 1 | 1 ( 4.2) | 6 ( 31.6) | ||
| 2 | 9 ( 37.5) | 8 ( 42.1) | ||
| 3 | 6 ( 25.0) | 3 ( 15.8) | ||
| 4 | 3 ( 12.5) | 2 ( 10.5) | ||
| AS_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme (%) | 0.065 | |||
| 0 | 5 ( 20.8) | 0 ( 0.0) | ||
| 1 | 9 ( 37.5) | 13 ( 68.4) | ||
| 2 | 6 ( 25.0) | 2 ( 10.5) | ||
| 3 | 4 ( 16.7) | 4 ( 21.1) | ||
| POR_VIRMaa_0_ei_1pellel_2pelvir_3niukui_4riikuiv (%) | 0.320 | |||
| 0 | 2 ( 8.3) | 1 ( 5.3) | ||
| 1 | 0 ( 0.0) | 3 ( 15.8) | ||
| 2 | 6 ( 25.0) | 3 ( 15.8) | ||
| 3 | 9 ( 37.5) | 8 ( 42.1) | ||
| 4 | 7 ( 29.2) | 4 ( 21.1) | ||
| POR_VIR_LELUKPL_0ei_1yksi_2kaksi_3kolme (%) | 0.415 | |||
| 0 | 1 ( 4.2) | 1 ( 5.3) | ||
| 1 | 4 ( 16.7) | 5 ( 26.3) | ||
| 2 | 18 ( 75.0) | 10 ( 52.6) | ||
| 3 | 1 ( 4.2) | 3 ( 15.8) | ||
| Koulmax_1peru_2ops_3a_4amk_5yl (%) | 0.833 | |||
| 2 | 2 ( 8.3) | 3 ( 15.8) | ||
| 3 | 16 ( 66.7) | 12 ( 63.2) | ||
| 4 | 4 ( 16.7) | 2 ( 10.5) | ||
| 5 | 2 ( 8.3) | 2 ( 10.5) | ||
| Stressi_1erpal_4jnkv (%) | 0.395 | |||
| 1 | 5 ( 20.8) | 1 ( 5.3) | ||
| 2 | 3 ( 12.5) | 5 ( 26.3) | ||
| 3 | 8 ( 33.3) | 6 ( 31.6) | ||
| 4 | 8 ( 33.3) | 7 ( 36.8) | ||
| EMKUOLLJAKO = 1 (%) | 6 ( 25.0) | 14 ( 73.7) | 0.004 | |
| EMPOISJAKO = 1 (%) | 0 ( 0.0) | 19 (100.0) | <0.001 | |
| EMENKUOLLJAKO = 1 (%) | 5 ( 20.8) | 13 ( 68.4) | 0.005 | |
| EMENPOISJAKO = 1 (%) | 1 ( 4.2) | 15 ( 78.9) | <0.001 | |
| NIVEL_01 = 2 (%) | 9 ( 37.5) | 9 ( 47.4) | 0.734 | |
| PAISE_01 = 2 (%) | 9 ( 37.5) | 9 ( 47.4) | 0.734 | |
| MAKUU01 = 2 (%) | 9 ( 37.5) | 9 ( 47.4) | 0.734 | |
| KOKO_01 = 2 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| OSA_01 = 2 (%) | 10 ( 41.7) | 8 ( 42.1) | 1.000 | |
| JOKUHYLK_01 = 2 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| PLEUR_01 = 1 (%) | 6 ( 25.0) | 6 ( 31.6) | 0.892 | |
| PNEUM_01 = 2 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| SAIRKARS_AST_TII = 1 (%) | 18 ( 75.0) | 15 ( 78.9) | 1.000 | |
| EMKUOL (mean (sd)) | 0.25 (0.44) | 0.74 (0.45) | 0.001 | |
| EMPOIS (mean (sd)) | 0.00 (0.00) | 1.00 (0.00) | <0.001 |
tilatkat<-tilat[,1:218]%>%mutate_all(as.factor)
tilatnum<-tilat[,219:233]%>%mutate_all(as.numeric)
tilat<-cbind(tilatkat,tilatnum)
res_mca = MCA(tilat, quanti.sup = c(219:233), graph = FALSE)
To visualize the percentage of inertia explained by each MCA dimension:
eig.val <- res_mca$eig
barplot(eig.val[, 2],
names.arg = 1:nrow(eig.val),
main = "Variances Explained by Dimensions (%)",
xlab = "Principal Dimensions",
ylab = "Percentage of variances",
col ="steelblue")
# Add connected line segments to the plot
lines(x = 1:nrow(eig.val), eig.val[, 2],
type = "b", pch = 19, col = "red")
fviz_mca_var(res_mca, choice = "mca.cor",
repel = TRUE, # Avoid text overlapping (slow)
ggtheme = theme_minimal())
To visualize the percentage of inertia explained by each MCA dimension:
fviz_mca_var(res_mca, col.var = "contrib",
gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
repel = TRUE, # avoid text overlapping (slow)
ggtheme = theme_minimal()
)
# load data
setwd("~/GitHub/tilataso")
library(readr)
tilapieni<-read.csv(file="tilapieni.csv", header=TRUE)
Valitsen muutaman jatkuvan muuttujan ja muutoin valitsen ne, joissa on alle 6 kategoriaa. Yhteenveto muuttujista:
tilapienikat<-tilapieni[1:76]%>%mutate_all(as.factor)
tilapieninum<-tilapieni[77:92]%>%mutate_all(as.numeric)
tilapieni<-cbind(tilapieninum,tilapienikat)
summaryKable(tilapieni) %>%
kable("html", align = "rrr", caption = "Data variable summary") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px")
| Min | 1st Q | Median | Mean | 3rd Q | Max | |
|---|---|---|---|---|---|---|
| Karjut_astsiem | 0.000 | 0.000 | 0.000 | 0.419 | 0.000 | 6.000 |
| emakot | 37.000 | 102.500 | 270.000 | 428.837 | 635.000 | 2100.000 |
| ensikot | 0.000 | 17.000 | 30.000 | 70.930 | 76.500 | 710.000 |
| lihasiat | 0.000 | 0.000 | 40.000 | 381.512 | 390.000 | 3000.000 |
| karjut | 1.000 | 2.000 | 2.000 | 2.907 | 4.000 | 7.000 |
| kokemusave | 3.000 | 11.000 | 16.500 | 17.802 | 25.000 | 40.000 |
| kokemusmax | 5.000 | 20.000 | 25.000 | 25.349 | 30.000 | 47.000 |
| emakoitaper | 10.000 | 60.000 | 100.000 | 103.765 | 137.915 | 350.000 |
| nivelpros | 0.000 | 1.540 | 2.100 | 2.695 | 3.440 | 13.330 |
| paisepros | 0.000 | 4.460 | 6.800 | 6.886 | 8.885 | 16.280 |
| keuhtulpros | 0.000 | 0.000 | 0.920 | 1.004 | 1.475 | 3.590 |
| keuhkopros | 0.000 | 0.965 | 1.700 | 7.626 | 10.625 | 36.360 |
| kokopros | 0.000 | 0.735 | 1.360 | 1.808 | 2.185 | 7.250 |
| osapros | 0.000 | 8.080 | 11.210 | 11.908 | 15.325 | 34.620 |
| emkuol | 0.000 | 5.540 | 8.700 | 9.840 | 13.900 | 26.760 |
| empoisp | 25.730 | 42.710 | 47.610 | 52.106 | 58.340 | 120.600 |
| Haastrooli_1OmEiosall_2OmOsall_3Esimies | Levels | 1: 10 | 2: 28 | 3: 5 | – | – |
| Tuotsuunta | Levels | 1: 22 | 2: 21 | – | – | – |
| Tautsu_012 | Levels | 0: 13 | 1: 13 | 2: 17 | – | – |
| PORSOSASTO_kertayt_0ei | Levels | 0: 25 | 1: 18 | – | – | – |
| PORS_pesu_0ei | Levels | 0: 10 | 1: 33 | – | – | – |
| PORS_desinf_0ei_1LIU_2KUIVA | Levels | 0: 9 | 1: 19 | 2: 10 | 12: 5 | – |
| PORS_tyhjana_mi1vr_0ei | Levels | 0: 17 | 1: 26 | – | – | – |
| Tuhoelmerkkeja_0kylla_1ei | Levels | 0: 33 | 1: 10 | – | – | – |
| kissoja0on1ei | Levels | 0: 26 | 0.5: 2 | 1: 15 | – | – |
| Kotielain_sikalaan_0kylla_1ei | Levels | 0: 9 | 1: 34 | – | – | – |
| Vesi_1kunn_0oma | Levels | 0: 16 | 1: 27 | – | – | – |
| ClC | Levels | 0: 40 | 1: 3 | – | – | – |
| ClA | Levels | 0: 43 | – | – | – | – |
| SI | Levels | 0: 39 | 1: 4 | – | – | – |
| APP | Levels | 0: 38 | 1: 5 | – | – | – |
| Loisaika_1ennenpors_2_porskars | Levels | 1: 27 | 2: 16 | – | – | – |
| Ton_tiheys_1aina_2jaetaan | Levels | 1: 39 | 2: 4 | – | – | – |
| Muutelkaynn_0ei_1_satunn_2kaynnmuusaann | Levels | 0: 16 | 1: 21 | 2: 6 | – | – |
| maitokuume | Levels | 0: 21 | 1: 22 | – | – | – |
| metriitti | Levels | 0: 24 | 1: 19 | – | – | – |
| valuttelu | Levels | 0: 38 | 1: 5 | – | – | – |
| mastiitti | Levels | 0: 33 | 1: 10 | – | – | – |
| ontuma | Levels | 0: 12 | 1: 31 | – | – | – |
| syomattomyys | Levels | 0: 21 | 1: 22 | – | – | – |
| kuume | Levels | 0: 37 | 1: 6 | – | – | – |
| loukkaantuminen | Levels | 0: 27 | 1: 16 | – | – | – |
| AB_rutiinilaak | Levels | 0: 37 | 1: 6 | – | – | – |
| Oksitosiini_rutiinisti | Levels | 0: 26 | 1: 17 | – | – | – |
| Kaynnistys_rutiinisti | Levels | 0: 39 | 1: 4 | – | – | – |
| NSAID_porsituksessa_rutiini | Levels | 0: 33 | 1: 10 | – | – | – |
| OMATENSIKOT_0EI_1KYLLa | Levels | 0: 15 | 1: 28 | – | – | – |
| Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk | Levels | 1: 1 | 2: 5 | 3: 35 | 4: 2 | – |
| Kiimantark_ryhmakaytt | Levels | 0: 5 | 1: 38 | – | – | – |
| Kiimantarkalkaa_vrkvier | Levels | 0: 12 | 1: 23 | 3: 3 | 4: 1 | 5: 4 |
| Kiimamerk_emakonselka | Levels | 0: 6 | 1: 37 | – | – | – |
| Kiimantark_postsiem | Levels | 0: 2 | 1: 41 | – | – | – |
| Postsiem_ryhmakaytt_havainnointi | Levels | 0: 5 | 1: 38 | – | – | – |
| Tiin_ultra2 | Levels | 6: 41 | 8: 1 | 10: 1 | – | – |
| Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen | Levels | 0: 16 | 1: 2 | 2: 8 | 3: 2 | 4: 15 |
| Pesantekomatmaara_1runsas_2jnkv_3niukka | Levels | 1: 3 | 2: 33 | 3: 7 | – | – |
| PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa | Levels | 1: 8 | 2: 35 | – | – | – |
| AS_maara123 | Levels | 0: 1 | 2: 37 | 3: 5 | – | – |
| AS_annostelu1234 | Levels | 0: 2 | 1: 40 | 3: 1 | – | – |
| AS_sairkars | Levels | 0: 32 | 1: 11 | – | – | – |
| AS_ruoklaite12345 | Levels | 0: 2 | 4: 41 | – | – | – |
| AS_ruokpaikka | Levels | 0: 1 | 1: 41 | 4: 1 | – | – |
| TII_alusta12345 | Levels | 1: 43 | – | – | – | – |
| TII_latt_rakenne1234 | Levels | 1: 5 | 12: 4 | 13: 33 | 23: 1 | – |
| TII_kuiv_mat12345 | Levels | 1: 5 | 2: 31 | 12: 3 | 14: 3 | 15: 1 |
| TII_maara1234 | Levels | 1: 4 | 2: 5 | 3: 25 | 4: 8 | 23: 1 |
| TII_tonkimat_6_mika | Levels | 1: 38 | 2: 1 | 3: 1 | 4: 1 | 5: 2 |
| TII_lelu1234 | Levels | 2: 2 | 4: 39 | 5: 1 | 24: 1 | – |
| TII_maara123 | Levels | 1: 4 | 1.5: 2 | 2: 35 | 3: 2 | – |
| TII_annostelu1234 | Levels | 1: 40 | 2: 1 | 4: 2 | – | – |
| TII_sairkars | Levels | 0: 4 | 1: 39 | – | – | – |
| POR_latt_rakenne1234 | Levels | 1: 2 | 2: 3 | 12: 36 | 13: 1 | 123: 1 |
| POR_maara1234 | Levels | 2: 8 | 3: 29 | 4: 6 | – | – |
| POR_tonkimat_6_mika | Levels | 1: 36 | 2: 1 | 3: 1 | 4: 4 | 5: 1 |
| POR_lelu1234 | Levels | 2: 1 | 3: 2 | 4: 39 | 5: 1 | – |
| POR_mat_vaiht | Levels | 1: 42 | 2: 1 | – | – | – |
| POR_maara123 | Levels | 1: 2 | 2: 39 | 3: 2 | – | – |
| POR_annostelu1234 | Levels | 1: 37 | 2: 3 | 3: 2 | 4: 1 | – |
| Koulmax_1peru_2ops_3a_4amk_5yl | Levels | 2: 5 | 3: 28 | 4: 6 | 5: 4 | – |
| Stressi_1erpal_4jnkv | Levels | 1: 6 | 2: 8 | 3: 14 | 4: 15 | – |
| EMKUOLLJAKO | Levels | 0: 23 | 1: 20 | – | – | – |
| EMPOISJAKO | Levels | 0: 24 | 1: 19 | – | – | – |
| EMENKUOLLJAKO | Levels | 0: 25 | 1: 18 | – | – | – |
| EMENPOISJAKO | Levels | 0: 27 | 1: 16 | – | – | – |
| NIVEL_01 | Levels | 1: 25 | 2: 18 | – | – | – |
| MAKUU01 | Levels | 1: 25 | 2: 18 | – | – | – |
| KOKO_01 | Levels | 1: 25 | 2: 18 | – | – | – |
| OSA_01 | Levels | 1: 25 | 2: 18 | – | – | – |
| JOKUHYLK_01 | Levels | 1: 25 | 2: 18 | – | – | – |
| PLEUR_01 | Levels | 0: 31 | 1: 12 | – | – | – |
| PNEUM_01 | Levels | 1: 25 | 2: 18 | – | – | – |
| SAIRKARS_AST_TII | Levels | 0: 10 | 1: 33 | – | – | – |
kuvat2<-tilapienikat
colnames(kuvat2)
## [1] "Haastrooli_1OmEiosall_2OmOsall_3Esimies"
## [2] "Tuotsuunta"
## [3] "Tautsu_012"
## [4] "PORSOSASTO_kertayt_0ei"
## [5] "PORS_pesu_0ei"
## [6] "PORS_desinf_0ei_1LIU_2KUIVA"
## [7] "PORS_tyhjana_mi1vr_0ei"
## [8] "Tuhoelmerkkeja_0kylla_1ei"
## [9] "kissoja0on1ei"
## [10] "Kotielain_sikalaan_0kylla_1ei"
## [11] "Vesi_1kunn_0oma"
## [12] "ClC"
## [13] "ClA"
## [14] "SI"
## [15] "APP"
## [16] "Loisaika_1ennenpors_2_porskars"
## [17] "Ton_tiheys_1aina_2jaetaan"
## [18] "Muutelkaynn_0ei_1_satunn_2kaynnmuusaann"
## [19] "maitokuume"
## [20] "metriitti"
## [21] "valuttelu"
## [22] "mastiitti"
## [23] "ontuma"
## [24] "syomattomyys"
## [25] "kuume"
## [26] "loukkaantuminen"
## [27] "AB_rutiinilaak"
## [28] "Oksitosiini_rutiinisti"
## [29] "Kaynnistys_rutiinisti"
## [30] "NSAID_porsituksessa_rutiini"
## [31] "OMATENSIKOT_0EI_1KYLLa"
## [32] "Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk"
## [33] "Kiimantark_ryhmakaytt"
## [34] "Kiimantarkalkaa_vrkvier"
## [35] "Kiimamerk_emakonselka"
## [36] "Kiimantark_postsiem"
## [37] "Postsiem_ryhmakaytt_havainnointi"
## [38] "Tiin_ultra2"
## [39] "Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen"
## [40] "Pesantekomatmaara_1runsas_2jnkv_3niukka"
## [41] "PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa"
## [42] "AS_maara123"
## [43] "AS_annostelu1234"
## [44] "AS_sairkars"
## [45] "AS_ruoklaite12345"
## [46] "AS_ruokpaikka"
## [47] "TII_alusta12345"
## [48] "TII_latt_rakenne1234"
## [49] "TII_kuiv_mat12345"
## [50] "TII_maara1234"
## [51] "TII_tonkimat_6_mika"
## [52] "TII_lelu1234"
## [53] "TII_maara123"
## [54] "TII_annostelu1234"
## [55] "TII_sairkars"
## [56] "POR_latt_rakenne1234"
## [57] "POR_maara1234"
## [58] "POR_tonkimat_6_mika"
## [59] "POR_lelu1234"
## [60] "POR_mat_vaiht"
## [61] "POR_maara123"
## [62] "POR_annostelu1234"
## [63] "Koulmax_1peru_2ops_3a_4amk_5yl"
## [64] "Stressi_1erpal_4jnkv"
## [65] "EMKUOLLJAKO"
## [66] "EMPOISJAKO"
## [67] "EMENKUOLLJAKO"
## [68] "EMENPOISJAKO"
## [69] "NIVEL_01"
## [70] "MAKUU01"
## [71] "KOKO_01"
## [72] "OSA_01"
## [73] "JOKUHYLK_01"
## [74] "PLEUR_01"
## [75] "PNEUM_01"
## [76] "SAIRKARS_AST_TII"
gather(kuvat2) %>% ggplot(aes(value)) + facet_wrap("key", scales = "free") + geom_bar(fill="purple") + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8))+ scale_fill_manual("key")
kor2<-tilapieninum
cor_fun <- function(data, mapping, method="pearson", ndp=2, sz=5, stars=TRUE, ...){
data <- na.omit(data[,c(as.character(mapping$x), as.character(mapping$y))])
x <- data[,as.character(mapping$x)]
y <- data[,as.character(mapping$y)]
corr <- cor.test(x, y, method=method)
est <- corr$estimate
lb.size <- sz* abs(est)
if(stars){
stars <- c("***", "**", "*", "")[findInterval(corr$p.value, c(0, 0.001, 0.01, 0.05, 1))]
lbl <- paste0(round(est, ndp), stars)
}else{
lbl <- round(est, ndp)
}
ggplot(data=data, mapping=mapping) +
annotate("text", x=mean(x), y=mean(y), label=lbl, size=lb.size,...)+
theme(panel.grid = element_blank())
}
ggpairs(kor2%>%mutate_all(as.numeric),
lower=list(continuous=wrap("smooth", colour="purple")),
diag=list(continuous=wrap("barDiag", fill="purple")),
upper=list(continuous=cor_fun),title="Graphical overview of the 17 variables")
KreateTableOne = function(x, ...){
t1 = tableone::CreateTableOne(data=x, ...)
t2 = print(t1, quote=TRUE)
rownames(t2) = gsub(pattern='\\"', replacement='', rownames(t2))
colnames(t2) = gsub(pattern='\\"', replacement='', colnames(t2))
return(t2)
}
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table1 = KreateTableOne(x=tilapieni, factorVars=colnames(tilapienikat), strata='EMKUOLLJAKO')
table1%>%
kable("html", align = "rrr", caption = "Data variable summary strat by EMKUOL") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 23 | 20 | ||
| Karjut_astsiem (mean (sd)) | 0.13 (0.46) | 0.75 (1.92) | 0.140 | |
| emakot (mean (sd)) | 305.26 (291.79) | 570.95 (509.87) | 0.039 | |
| ensikot (mean (sd)) | 41.52 (45.16) | 104.75 (174.17) | 0.101 | |
| lihasiat (mean (sd)) | 406.13 (718.12) | 353.20 (773.30) | 0.817 | |
| karjut (mean (sd)) | 2.43 (1.59) | 3.45 (1.90) | 0.064 | |
| kokemusave (mean (sd)) | 21.07 (10.17) | 14.05 (7.17) | 0.014 | |
| kokemusmax (mean (sd)) | 27.39 (11.19) | 23.00 (9.22) | 0.172 | |
| emakoitaper (mean (sd)) | 88.01 (46.20) | 121.88 (74.77) | 0.077 | |
| nivelpros (mean (sd)) | 2.23 (2.37) | 3.23 (2.68) | 0.202 | |
| paisepros (mean (sd)) | 6.45 (4.38) | 7.39 (4.14) | 0.478 | |
| keuhtulpros (mean (sd)) | 0.87 (0.92) | 1.16 (0.92) | 0.315 | |
| keuhkopros (mean (sd)) | 4.00 (7.16) | 11.80 (13.39) | 0.020 | |
| kokopros (mean (sd)) | 1.35 (1.37) | 2.34 (2.08) | 0.070 | |
| osapros (mean (sd)) | 11.59 (8.27) | 12.28 (5.34) | 0.752 | |
| emkuol (mean (sd)) | 5.43 (2.52) | 14.91 (4.55) | <0.001 | |
| empoisp (mean (sd)) | 44.45 (12.12) | 60.90 (18.90) | 0.001 | |
| Haastrooli_1OmEiosall_2OmOsall_3Esimies (%) | 0.431 | |||
| 1 | 4 ( 17.4) | 6 ( 30.0) | ||
| 2 | 17 ( 73.9) | 11 ( 55.0) | ||
| 3 | 2 ( 8.7) | 3 ( 15.0) | ||
| Tuotsuunta = 2 (%) | 14 ( 60.9) | 7 ( 35.0) | 0.165 | |
| Tautsu_012 (%) | 0.733 | |||
| 0 | 8 ( 34.8) | 5 ( 25.0) | ||
| 1 | 7 ( 30.4) | 6 ( 30.0) | ||
| 2 | 8 ( 34.8) | 9 ( 45.0) | ||
| PORSOSASTO_kertayt_0ei = 1 (%) | 9 ( 39.1) | 9 ( 45.0) | 0.937 | |
| PORS_pesu_0ei = 1 (%) | 17 ( 73.9) | 16 ( 80.0) | 0.913 | |
| PORS_desinf_0ei_1LIU_2KUIVA (%) | 0.623 | |||
| 0 | 5 ( 21.7) | 4 ( 20.0) | ||
| 1 | 9 ( 39.1) | 10 ( 50.0) | ||
| 2 | 7 ( 30.4) | 3 ( 15.0) | ||
| 12 | 2 ( 8.7) | 3 ( 15.0) | ||
| PORS_tyhjana_mi1vr_0ei = 1 (%) | 13 ( 56.5) | 13 ( 65.0) | 0.799 | |
| Tuhoelmerkkeja_0kylla_1ei = 1 (%) | 5 ( 21.7) | 5 ( 25.0) | 1.000 | |
| kissoja0on1ei (%) | 0.005 | |||
| 0 | 19 ( 82.6) | 7 ( 35.0) | ||
| 0.5 | 0 ( 0.0) | 2 ( 10.0) | ||
| 1 | 4 ( 17.4) | 11 ( 55.0) | ||
| Kotielain_sikalaan_0kylla_1ei = 1 (%) | 17 ( 73.9) | 17 ( 85.0) | 0.606 | |
| Vesi_1kunn_0oma = 1 (%) | 16 ( 69.6) | 11 ( 55.0) | 0.503 | |
| ClC = 1 (%) | 1 ( 4.3) | 2 ( 10.0) | 0.900 | |
| ClA = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| SI = 1 (%) | 1 ( 4.3) | 3 ( 15.0) | 0.501 | |
| APP = 1 (%) | 3 ( 13.0) | 2 ( 10.0) | 1.000 | |
| Loisaika_1ennenpors_2_porskars = 2 (%) | 9 ( 39.1) | 7 ( 35.0) | 1.000 | |
| Ton_tiheys_1aina_2jaetaan = 2 (%) | 4 ( 17.4) | 0 ( 0.0) | 0.152 | |
| Muutelkaynn_0ei_1_satunn_2kaynnmuusaann (%) | 0.142 | |||
| 0 | 10 ( 43.5) | 6 ( 30.0) | ||
| 1 | 12 ( 52.2) | 9 ( 45.0) | ||
| 2 | 1 ( 4.3) | 5 ( 25.0) | ||
| maitokuume = 1 (%) | 12 ( 52.2) | 10 ( 50.0) | 1.000 | |
| metriitti = 1 (%) | 10 ( 43.5) | 9 ( 45.0) | 1.000 | |
| valuttelu = 1 (%) | 2 ( 8.7) | 3 ( 15.0) | 0.868 | |
| mastiitti = 1 (%) | 4 ( 17.4) | 6 ( 30.0) | 0.539 | |
| ontuma = 1 (%) | 15 ( 65.2) | 16 ( 80.0) | 0.461 | |
| syomattomyys = 1 (%) | 10 ( 43.5) | 12 ( 60.0) | 0.438 | |
| kuume = 1 (%) | 2 ( 8.7) | 4 ( 20.0) | 0.531 | |
| loukkaantuminen = 1 (%) | 10 ( 43.5) | 6 ( 30.0) | 0.551 | |
| AB_rutiinilaak = 1 (%) | 2 ( 8.7) | 4 ( 20.0) | 0.531 | |
| Oksitosiini_rutiinisti = 1 (%) | 8 ( 34.8) | 9 ( 45.0) | 0.711 | |
| Kaynnistys_rutiinisti = 1 (%) | 0 ( 0.0) | 4 ( 20.0) | 0.084 | |
| NSAID_porsituksessa_rutiini = 1 (%) | 6 ( 26.1) | 4 ( 20.0) | 0.913 | |
| OMATENSIKOT_0EI_1KYLLa = 1 (%) | 15 ( 65.2) | 13 ( 65.0) | 1.000 | |
| Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk (%) | 0.386 | |||
| 1 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 3 ( 13.0) | 2 ( 10.0) | ||
| 3 | 17 ( 73.9) | 18 ( 90.0) | ||
| 4 | 2 ( 8.7) | 0 ( 0.0) | ||
| Kiimantark_ryhmakaytt = 1 (%) | 20 ( 87.0) | 18 ( 90.0) | 1.000 | |
| Kiimantarkalkaa_vrkvier (%) | 0.264 | |||
| 0 | 7 ( 30.4) | 5 ( 25.0) | ||
| 1 | 14 ( 60.9) | 9 ( 45.0) | ||
| 3 | 0 ( 0.0) | 3 ( 15.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 2 ( 8.7) | 2 ( 10.0) | ||
| Kiimamerk_emakonselka = 1 (%) | 17 ( 73.9) | 20 (100.0) | 0.043 | |
| Kiimantark_postsiem = 1 (%) | 21 ( 91.3) | 20 (100.0) | 0.532 | |
| Postsiem_ryhmakaytt_havainnointi = 1 (%) | 20 ( 87.0) | 18 ( 90.0) | 1.000 | |
| Tiin_ultra2 (%) | 0.364 | |||
| 6 | 22 ( 95.7) | 19 ( 95.0) | ||
| 8 | 1 ( 4.3) | 0 ( 0.0) | ||
| 10 | 0 ( 0.0) | 1 ( 5.0) | ||
| Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen (%) | 0.115 | |||
| 0 | 10 ( 43.5) | 6 ( 30.0) | ||
| 1 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2 | 2 ( 8.7) | 6 ( 30.0) | ||
| 3 | 2 ( 8.7) | 0 ( 0.0) | ||
| 4 | 9 ( 39.1) | 6 ( 30.0) | ||
| Pesantekomatmaara_1runsas_2jnkv_3niukka (%) | 0.763 | |||
| 1 | 1 ( 4.3) | 2 ( 10.0) | ||
| 2 | 18 ( 78.3) | 15 ( 75.0) | ||
| 3 | 4 ( 17.4) | 3 ( 15.0) | ||
| PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa = 2 (%) | 19 ( 82.6) | 16 ( 80.0) | 1.000 | |
| AS_maara123 (%) | 0.054 | |||
| 0 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2 | 18 ( 78.3) | 19 ( 95.0) | ||
| 3 | 5 ( 21.7) | 0 ( 0.0) | ||
| AS_annostelu1234 (%) | 0.639 | |||
| 0 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 21 ( 91.3) | 19 ( 95.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| AS_sairkars = 1 (%) | 3 ( 13.0) | 8 ( 40.0) | 0.095 | |
| AS_ruoklaite12345 = 4 (%) | 22 ( 95.7) | 19 ( 95.0) | 1.000 | |
| AS_ruokpaikka (%) | 0.402 | |||
| 0 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1 | 21 ( 91.3) | 20 (100.0) | ||
| 4 | 1 ( 4.3) | 0 ( 0.0) | ||
| TII_alusta12345 = 1 (%) | 23 (100.0) | 20 (100.0) | NA | |
| TII_latt_rakenne1234 (%) | 0.624 | |||
| 1 | 2 ( 8.7) | 3 ( 15.0) | ||
| 12 | 2 ( 8.7) | 2 ( 10.0) | ||
| 13 | 19 ( 82.6) | 14 ( 70.0) | ||
| 23 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_kuiv_mat12345 (%) | 0.508 | |||
| 1 | 4 ( 17.4) | 1 ( 5.0) | ||
| 2 | 15 ( 65.2) | 16 ( 80.0) | ||
| 12 | 1 ( 4.3) | 2 ( 10.0) | ||
| 14 | 2 ( 8.7) | 1 ( 5.0) | ||
| 15 | 1 ( 4.3) | 0 ( 0.0) | ||
| TII_maara1234 (%) | 0.669 | |||
| 1 | 3 ( 13.0) | 1 ( 5.0) | ||
| 2 | 2 ( 8.7) | 3 ( 15.0) | ||
| 3 | 14 ( 60.9) | 11 ( 55.0) | ||
| 4 | 4 ( 17.4) | 4 ( 20.0) | ||
| 23 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_tonkimat_6_mika (%) | 0.440 | |||
| 1 | 22 ( 95.7) | 16 ( 80.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 1 ( 4.3) | 1 ( 5.0) | ||
| TII_lelu1234 (%) | 0.257 | |||
| 2 | 2 ( 8.7) | 0 ( 0.0) | ||
| 4 | 21 ( 91.3) | 18 ( 90.0) | ||
| 5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 24 | 0 ( 0.0) | 1 ( 5.0) | ||
| TII_maara123 (%) | 0.844 | |||
| 1 | 3 ( 13.0) | 1 ( 5.0) | ||
| 1.5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 2 | 18 ( 78.3) | 17 ( 85.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| TII_annostelu1234 (%) | 0.550 | |||
| 1 | 22 ( 95.7) | 18 ( 90.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4 | 1 ( 4.3) | 1 ( 5.0) | ||
| TII_sairkars = 1 (%) | 21 ( 91.3) | 18 ( 90.0) | 1.000 | |
| POR_latt_rakenne1234 (%) | 0.387 | |||
| 1 | 2 ( 8.7) | 0 ( 0.0) | ||
| 2 | 2 ( 8.7) | 1 ( 5.0) | ||
| 12 | 18 ( 78.3) | 18 ( 90.0) | ||
| 13 | 0 ( 0.0) | 1 ( 5.0) | ||
| 123 | 1 ( 4.3) | 0 ( 0.0) | ||
| POR_maara1234 (%) | 0.020 | |||
| 2 | 1 ( 4.3) | 7 ( 35.0) | ||
| 3 | 17 ( 73.9) | 12 ( 60.0) | ||
| 4 | 5 ( 21.7) | 1 ( 5.0) | ||
| POR_tonkimat_6_mika (%) | 0.307 | |||
| 1 | 21 ( 91.3) | 15 ( 75.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4 | 1 ( 4.3) | 3 ( 15.0) | ||
| 5 | 0 ( 0.0) | 1 ( 5.0) | ||
| POR_lelu1234 (%) | 0.216 | |||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 2 ( 10.0) | ||
| 4 | 22 ( 95.7) | 17 ( 85.0) | ||
| 5 | 0 ( 0.0) | 1 ( 5.0) | ||
| POR_mat_vaiht = 2 (%) | 1 ( 4.3) | 0 ( 0.0) | 1.000 | |
| POR_maara123 (%) | 0.401 | |||
| 1 | 2 ( 8.7) | 0 ( 0.0) | ||
| 2 | 20 ( 87.0) | 19 ( 95.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| POR_annostelu1234 (%) | 0.763 | |||
| 1 | 19 ( 82.6) | 18 ( 90.0) | ||
| 2 | 2 ( 8.7) | 1 ( 5.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| 4 | 1 ( 4.3) | 0 ( 0.0) | ||
| Koulmax_1peru_2ops_3a_4amk_5yl (%) | 0.613 | |||
| 2 | 3 ( 13.0) | 2 ( 10.0) | ||
| 3 | 15 ( 65.2) | 13 ( 65.0) | ||
| 4 | 4 ( 17.4) | 2 ( 10.0) | ||
| 5 | 1 ( 4.3) | 3 ( 15.0) | ||
| Stressi_1erpal_4jnkv (%) | 0.846 | |||
| 1 | 4 ( 17.4) | 2 ( 10.0) | ||
| 2 | 4 ( 17.4) | 4 ( 20.0) | ||
| 3 | 8 ( 34.8) | 6 ( 30.0) | ||
| 4 | 7 ( 30.4) | 8 ( 40.0) | ||
| EMKUOLLJAKO = 1 (%) | 0 ( 0.0) | 20 (100.0) | <0.001 | |
| EMPOISJAKO = 1 (%) | 5 ( 21.7) | 14 ( 70.0) | 0.004 | |
| EMENKUOLLJAKO = 1 (%) | 1 ( 4.3) | 17 ( 85.0) | <0.001 | |
| EMENPOISJAKO = 1 (%) | 3 ( 13.0) | 13 ( 65.0) | 0.001 | |
| NIVEL_01 = 2 (%) | 8 ( 34.8) | 10 ( 50.0) | 0.485 | |
| MAKUU01 = 2 (%) | 7 ( 30.4) | 11 ( 55.0) | 0.187 | |
| KOKO_01 = 2 (%) | 7 ( 30.4) | 11 ( 55.0) | 0.187 | |
| OSA_01 = 2 (%) | 9 ( 39.1) | 9 ( 45.0) | 0.937 | |
| JOKUHYLK_01 = 2 (%) | 6 ( 26.1) | 12 ( 60.0) | 0.053 | |
| PLEUR_01 = 1 (%) | 4 ( 17.4) | 8 ( 40.0) | 0.191 | |
| PNEUM_01 = 2 (%) | 7 ( 30.4) | 11 ( 55.0) | 0.187 | |
| SAIRKARS_AST_TII = 1 (%) | 15 ( 65.2) | 18 ( 90.0) | 0.120 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table2 = KreateTableOne(x=tilapieni, factorVars=colnames(tilapienikat), strata='EMPOISJAKO')
table2%>%
kable("html", align = "rrr", caption = "Data variable summary strat by EMPOIS") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 24 | 19 | ||
| Karjut_astsiem (mean (sd)) | 0.12 (0.45) | 0.79 (1.96) | 0.114 | |
| emakot (mean (sd)) | 295.88 (277.03) | 596.79 (518.67) | 0.019 | |
| ensikot (mean (sd)) | 37.08 (42.04) | 113.68 (176.56) | 0.046 | |
| lihasiat (mean (sd)) | 287.54 (535.14) | 500.21 (933.06) | 0.353 | |
| karjut (mean (sd)) | 2.25 (1.42) | 3.74 (1.91) | 0.006 | |
| kokemusave (mean (sd)) | 18.94 (9.43) | 16.37 (9.60) | 0.384 | |
| kokemusmax (mean (sd)) | 25.42 (10.78) | 25.26 (10.29) | 0.962 | |
| emakoitaper (mean (sd)) | 88.13 (43.78) | 123.52 (77.49) | 0.066 | |
| nivelpros (mean (sd)) | 2.37 (2.27) | 3.11 (2.85) | 0.349 | |
| paisepros (mean (sd)) | 6.74 (4.76) | 7.06 (3.61) | 0.809 | |
| keuhtulpros (mean (sd)) | 0.76 (0.73) | 1.31 (1.06) | 0.051 | |
| keuhkopros (mean (sd)) | 5.05 (8.11) | 10.88 (13.57) | 0.088 | |
| kokopros (mean (sd)) | 1.62 (1.80) | 2.04 (1.79) | 0.449 | |
| osapros (mean (sd)) | 11.72 (8.09) | 12.14 (5.50) | 0.849 | |
| emkuol (mean (sd)) | 7.42 (3.73) | 12.90 (6.90) | 0.002 | |
| empoisp (mean (sd)) | 41.22 (6.16) | 65.85 (17.65) | <0.001 | |
| Haastrooli_1OmEiosall_2OmOsall_3Esimies (%) | 0.311 | |||
| 1 | 4 ( 16.7) | 6 ( 31.6) | ||
| 2 | 18 ( 75.0) | 10 ( 52.6) | ||
| 3 | 2 ( 8.3) | 3 ( 15.8) | ||
| Tuotsuunta = 2 (%) | 13 ( 54.2) | 8 ( 42.1) | 0.632 | |
| Tautsu_012 (%) | 0.473 | |||
| 0 | 9 ( 37.5) | 4 ( 21.1) | ||
| 1 | 7 ( 29.2) | 6 ( 31.6) | ||
| 2 | 8 ( 33.3) | 9 ( 47.4) | ||
| PORSOSASTO_kertayt_0ei = 1 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| PORS_pesu_0ei = 1 (%) | 20 ( 83.3) | 13 ( 68.4) | 0.432 | |
| PORS_desinf_0ei_1LIU_2KUIVA (%) | 0.894 | |||
| 0 | 4 ( 16.7) | 5 ( 26.3) | ||
| 1 | 11 ( 45.8) | 8 ( 42.1) | ||
| 2 | 6 ( 25.0) | 4 ( 21.1) | ||
| 12 | 3 ( 12.5) | 2 ( 10.5) | ||
| PORS_tyhjana_mi1vr_0ei = 1 (%) | 14 ( 58.3) | 12 ( 63.2) | 0.994 | |
| Tuhoelmerkkeja_0kylla_1ei = 1 (%) | 6 ( 25.0) | 4 ( 21.1) | 1.000 | |
| kissoja0on1ei (%) | 0.051 | |||
| 0 | 18 ( 75.0) | 8 ( 42.1) | ||
| 0.5 | 0 ( 0.0) | 2 ( 10.5) | ||
| 1 | 6 ( 25.0) | 9 ( 47.4) | ||
| Kotielain_sikalaan_0kylla_1ei = 1 (%) | 20 ( 83.3) | 14 ( 73.7) | 0.693 | |
| Vesi_1kunn_0oma = 1 (%) | 15 ( 62.5) | 12 ( 63.2) | 1.000 | |
| ClC = 1 (%) | 1 ( 4.2) | 2 ( 10.5) | 0.833 | |
| ClA = 0 (%) | 24 (100.0) | 19 (100.0) | NA | |
| SI = 1 (%) | 1 ( 4.2) | 3 ( 15.8) | 0.439 | |
| APP = 1 (%) | 4 ( 16.7) | 1 ( 5.3) | 0.497 | |
| Loisaika_1ennenpors_2_porskars = 2 (%) | 8 ( 33.3) | 8 ( 42.1) | 0.785 | |
| Ton_tiheys_1aina_2jaetaan = 2 (%) | 3 ( 12.5) | 1 ( 5.3) | 0.777 | |
| Muutelkaynn_0ei_1_satunn_2kaynnmuusaann (%) | 0.089 | |||
| 0 | 11 ( 45.8) | 5 ( 26.3) | ||
| 1 | 12 ( 50.0) | 9 ( 47.4) | ||
| 2 | 1 ( 4.2) | 5 ( 26.3) | ||
| maitokuume = 1 (%) | 12 ( 50.0) | 10 ( 52.6) | 1.000 | |
| metriitti = 1 (%) | 10 ( 41.7) | 9 ( 47.4) | 0.948 | |
| valuttelu = 1 (%) | 3 ( 12.5) | 2 ( 10.5) | 1.000 | |
| mastiitti = 1 (%) | 5 ( 20.8) | 5 ( 26.3) | 0.953 | |
| ontuma = 1 (%) | 15 ( 62.5) | 16 ( 84.2) | 0.217 | |
| syomattomyys = 1 (%) | 14 ( 58.3) | 8 ( 42.1) | 0.453 | |
| kuume = 1 (%) | 5 ( 20.8) | 1 ( 5.3) | 0.308 | |
| loukkaantuminen = 1 (%) | 11 ( 45.8) | 5 ( 26.3) | 0.319 | |
| AB_rutiinilaak = 1 (%) | 3 ( 12.5) | 3 ( 15.8) | 1.000 | |
| Oksitosiini_rutiinisti = 1 (%) | 7 ( 29.2) | 10 ( 52.6) | 0.212 | |
| Kaynnistys_rutiinisti = 1 (%) | 0 ( 0.0) | 4 ( 21.1) | 0.067 | |
| NSAID_porsituksessa_rutiini = 1 (%) | 6 ( 25.0) | 4 ( 21.1) | 1.000 | |
| OMATENSIKOT_0EI_1KYLLa = 1 (%) | 15 ( 62.5) | 13 ( 68.4) | 0.934 | |
| Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk (%) | 0.828 | |||
| 1 | 1 ( 4.2) | 0 ( 0.0) | ||
| 2 | 3 ( 12.5) | 2 ( 10.5) | ||
| 3 | 19 ( 79.2) | 16 ( 84.2) | ||
| 4 | 1 ( 4.2) | 1 ( 5.3) | ||
| Kiimantark_ryhmakaytt = 1 (%) | 21 ( 87.5) | 17 ( 89.5) | 1.000 | |
| Kiimantarkalkaa_vrkvier (%) | 0.224 | |||
| 0 | 5 ( 20.8) | 7 ( 36.8) | ||
| 1 | 16 ( 66.7) | 7 ( 36.8) | ||
| 3 | 2 ( 8.3) | 1 ( 5.3) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| 5 | 1 ( 4.2) | 3 ( 15.8) | ||
| Kiimamerk_emakonselka = 1 (%) | 18 ( 75.0) | 19 (100.0) | 0.057 | |
| Kiimantark_postsiem = 1 (%) | 23 ( 95.8) | 18 ( 94.7) | 1.000 | |
| Postsiem_ryhmakaytt_havainnointi = 1 (%) | 21 ( 87.5) | 17 ( 89.5) | 1.000 | |
| Tiin_ultra2 (%) | 0.266 | |||
| 6 | 24 (100.0) | 17 ( 89.5) | ||
| 8 | 0 ( 0.0) | 1 ( 5.3) | ||
| 10 | 0 ( 0.0) | 1 ( 5.3) | ||
| Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen (%) | 0.085 | |||
| 0 | 10 ( 41.7) | 6 ( 31.6) | ||
| 1 | 0 ( 0.0) | 2 ( 10.5) | ||
| 2 | 2 ( 8.3) | 6 ( 31.6) | ||
| 3 | 2 ( 8.3) | 0 ( 0.0) | ||
| 4 | 10 ( 41.7) | 5 ( 26.3) | ||
| Pesantekomatmaara_1runsas_2jnkv_3niukka (%) | 0.269 | |||
| 1 | 3 ( 12.5) | 0 ( 0.0) | ||
| 2 | 17 ( 70.8) | 16 ( 84.2) | ||
| 3 | 4 ( 16.7) | 3 ( 15.8) | ||
| PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa = 2 (%) | 20 ( 83.3) | 15 ( 78.9) | 1.000 | |
| AS_maara123 (%) | 0.320 | |||
| 0 | 1 ( 4.2) | 0 ( 0.0) | ||
| 2 | 19 ( 79.2) | 18 ( 94.7) | ||
| 3 | 4 ( 16.7) | 1 ( 5.3) | ||
| AS_annostelu1234 (%) | 0.660 | |||
| 0 | 1 ( 4.2) | 1 ( 5.3) | ||
| 1 | 22 ( 91.7) | 18 ( 94.7) | ||
| 3 | 1 ( 4.2) | 0 ( 0.0) | ||
| AS_sairkars = 1 (%) | 6 ( 25.0) | 5 ( 26.3) | 1.000 | |
| AS_ruoklaite12345 = 4 (%) | 24 (100.0) | 17 ( 89.5) | 0.369 | |
| AS_ruokpaikka (%) | 0.266 | |||
| 0 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 24 (100.0) | 17 ( 89.5) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_alusta12345 = 1 (%) | 24 (100.0) | 19 (100.0) | NA | |
| TII_latt_rakenne1234 (%) | 0.471 | |||
| 1 | 4 ( 16.7) | 1 ( 5.3) | ||
| 12 | 2 ( 8.3) | 2 ( 10.5) | ||
| 13 | 18 ( 75.0) | 15 ( 78.9) | ||
| 23 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_kuiv_mat12345 (%) | 0.565 | |||
| 1 | 4 ( 16.7) | 1 ( 5.3) | ||
| 2 | 15 ( 62.5) | 16 ( 84.2) | ||
| 12 | 2 ( 8.3) | 1 ( 5.3) | ||
| 14 | 2 ( 8.3) | 1 ( 5.3) | ||
| 15 | 1 ( 4.2) | 0 ( 0.0) | ||
| TII_maara1234 (%) | 0.508 | |||
| 1 | 3 ( 12.5) | 1 ( 5.3) | ||
| 2 | 4 ( 16.7) | 1 ( 5.3) | ||
| 3 | 13 ( 54.2) | 12 ( 63.2) | ||
| 4 | 4 ( 16.7) | 4 ( 21.1) | ||
| 23 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_tonkimat_6_mika (%) | 0.186 | |||
| 1 | 23 ( 95.8) | 15 ( 78.9) | ||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| 5 | 0 ( 0.0) | 2 ( 10.5) | ||
| TII_lelu1234 (%) | 0.296 | |||
| 2 | 2 ( 8.3) | 0 ( 0.0) | ||
| 4 | 21 ( 87.5) | 18 ( 94.7) | ||
| 5 | 1 ( 4.2) | 0 ( 0.0) | ||
| 24 | 0 ( 0.0) | 1 ( 5.3) | ||
| TII_maara123 (%) | 0.877 | |||
| 1 | 3 ( 12.5) | 1 ( 5.3) | ||
| 1.5 | 1 ( 4.2) | 1 ( 5.3) | ||
| 2 | 19 ( 79.2) | 16 ( 84.2) | ||
| 3 | 1 ( 4.2) | 1 ( 5.3) | ||
| TII_annostelu1234 (%) | 0.513 | |||
| 1 | 23 ( 95.8) | 17 ( 89.5) | ||
| 2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 4 | 1 ( 4.2) | 1 ( 5.3) | ||
| TII_sairkars = 1 (%) | 23 ( 95.8) | 16 ( 84.2) | 0.439 | |
| POR_latt_rakenne1234 (%) | 0.164 | |||
| 1 | 2 ( 8.3) | 0 ( 0.0) | ||
| 2 | 3 ( 12.5) | 0 ( 0.0) | ||
| 12 | 18 ( 75.0) | 18 ( 94.7) | ||
| 13 | 0 ( 0.0) | 1 ( 5.3) | ||
| 123 | 1 ( 4.2) | 0 ( 0.0) | ||
| POR_maara1234 (%) | 0.265 | |||
| 2 | 5 ( 20.8) | 3 ( 15.8) | ||
| 3 | 14 ( 58.3) | 15 ( 78.9) | ||
| 4 | 5 ( 20.8) | 1 ( 5.3) | ||
| POR_tonkimat_6_mika (%) | 0.081 | |||
| 1 | 22 ( 91.7) | 14 ( 73.7) | ||
| 2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 3 | 1 ( 4.2) | 0 ( 0.0) | ||
| 4 | 0 ( 0.0) | 4 ( 21.1) | ||
| 5 | 1 ( 4.2) | 0 ( 0.0) | ||
| POR_lelu1234 (%) | 0.643 | |||
| 2 | 1 ( 4.2) | 0 ( 0.0) | ||
| 3 | 1 ( 4.2) | 1 ( 5.3) | ||
| 4 | 21 ( 87.5) | 18 ( 94.7) | ||
| 5 | 1 ( 4.2) | 0 ( 0.0) | ||
| POR_mat_vaiht = 2 (%) | 0 ( 0.0) | 1 ( 5.3) | 0.906 | |
| POR_maara123 (%) | 0.433 | |||
| 1 | 2 ( 8.3) | 0 ( 0.0) | ||
| 2 | 21 ( 87.5) | 18 ( 94.7) | ||
| 3 | 1 ( 4.2) | 1 ( 5.3) | ||
| POR_annostelu1234 (%) | 0.386 | |||
| 1 | 20 ( 83.3) | 17 ( 89.5) | ||
| 2 | 2 ( 8.3) | 1 ( 5.3) | ||
| 3 | 2 ( 8.3) | 0 ( 0.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| Koulmax_1peru_2ops_3a_4amk_5yl (%) | 0.833 | |||
| 2 | 2 ( 8.3) | 3 ( 15.8) | ||
| 3 | 16 ( 66.7) | 12 ( 63.2) | ||
| 4 | 4 ( 16.7) | 2 ( 10.5) | ||
| 5 | 2 ( 8.3) | 2 ( 10.5) | ||
| Stressi_1erpal_4jnkv (%) | 0.395 | |||
| 1 | 5 ( 20.8) | 1 ( 5.3) | ||
| 2 | 3 ( 12.5) | 5 ( 26.3) | ||
| 3 | 8 ( 33.3) | 6 ( 31.6) | ||
| 4 | 8 ( 33.3) | 7 ( 36.8) | ||
| EMKUOLLJAKO = 1 (%) | 6 ( 25.0) | 14 ( 73.7) | 0.004 | |
| EMPOISJAKO = 1 (%) | 0 ( 0.0) | 19 (100.0) | <0.001 | |
| EMENKUOLLJAKO = 1 (%) | 5 ( 20.8) | 13 ( 68.4) | 0.005 | |
| EMENPOISJAKO = 1 (%) | 1 ( 4.2) | 15 ( 78.9) | <0.001 | |
| NIVEL_01 = 2 (%) | 9 ( 37.5) | 9 ( 47.4) | 0.734 | |
| MAKUU01 = 2 (%) | 9 ( 37.5) | 9 ( 47.4) | 0.734 | |
| KOKO_01 = 2 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| OSA_01 = 2 (%) | 10 ( 41.7) | 8 ( 42.1) | 1.000 | |
| JOKUHYLK_01 = 2 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| PLEUR_01 = 1 (%) | 6 ( 25.0) | 6 ( 31.6) | 0.892 | |
| PNEUM_01 = 2 (%) | 8 ( 33.3) | 10 ( 52.6) | 0.336 | |
| SAIRKARS_AST_TII = 1 (%) | 18 ( 75.0) | 15 ( 78.9) | 1.000 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table3 = KreateTableOne(x=tilapieni, factorVars=colnames(tilapienikat), strata='JOKUHYLK_01')
table3%>%
kable("html", align = "rrr", caption = "Data variable summary strat by JOKUHYLK") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 1 | 2 | p | test | |
|---|---|---|---|---|
| n | 25 | 18 | ||
| Karjut_astsiem (mean (sd)) | 0.36 (1.25) | 0.50 (1.54) | 0.745 | |
| emakot (mean (sd)) | 323.76 (312.17) | 574.78 (518.46) | 0.055 | |
| ensikot (mean (sd)) | 43.88 (48.42) | 108.50 (182.14) | 0.097 | |
| lihasiat (mean (sd)) | 256.44 (609.78) | 555.22 (870.39) | 0.192 | |
| karjut (mean (sd)) | 2.60 (1.53) | 3.33 (2.09) | 0.190 | |
| kokemusave (mean (sd)) | 19.30 (8.91) | 15.72 (10.11) | 0.227 | |
| kokemusmax (mean (sd)) | 26.80 (10.61) | 23.33 (10.14) | 0.288 | |
| emakoitaper (mean (sd)) | 88.71 (50.44) | 124.67 (73.11) | 0.063 | |
| nivelpros (mean (sd)) | 1.98 (2.24) | 3.69 (2.66) | 0.027 | |
| paisepros (mean (sd)) | 4.82 (2.72) | 9.75 (4.37) | <0.001 | |
| keuhtulpros (mean (sd)) | 0.77 (0.82) | 1.33 (0.97) | 0.046 | |
| keuhkopros (mean (sd)) | 1.60 (2.23) | 15.99 (13.07) | <0.001 | |
| kokopros (mean (sd)) | 0.95 (0.81) | 2.99 (2.10) | <0.001 | |
| osapros (mean (sd)) | 8.60 (4.88) | 16.51 (6.96) | <0.001 | |
| emkuol (mean (sd)) | 7.85 (4.73) | 12.60 (6.51) | 0.008 | |
| empoisp (mean (sd)) | 50.27 (19.07) | 54.66 (15.30) | 0.425 | |
| Haastrooli_1OmEiosall_2OmOsall_3Esimies (%) | 0.539 | |||
| 1 | 6 ( 24.0) | 4 ( 22.2) | ||
| 2 | 15 ( 60.0) | 13 ( 72.2) | ||
| 3 | 4 ( 16.0) | 1 ( 5.6) | ||
| Tuotsuunta = 2 (%) | 12 ( 48.0) | 9 ( 50.0) | 1.000 | |
| Tautsu_012 (%) | 0.922 | |||
| 0 | 8 ( 32.0) | 5 ( 27.8) | ||
| 1 | 7 ( 28.0) | 6 ( 33.3) | ||
| 2 | 10 ( 40.0) | 7 ( 38.9) | ||
| PORSOSASTO_kertayt_0ei = 1 (%) | 8 ( 32.0) | 10 ( 55.6) | 0.218 | |
| PORS_pesu_0ei = 1 (%) | 19 ( 76.0) | 14 ( 77.8) | 1.000 | |
| PORS_desinf_0ei_1LIU_2KUIVA (%) | 0.913 | |||
| 0 | 6 ( 24.0) | 3 ( 16.7) | ||
| 1 | 10 ( 40.0) | 9 ( 50.0) | ||
| 2 | 6 ( 24.0) | 4 ( 22.2) | ||
| 12 | 3 ( 12.0) | 2 ( 11.1) | ||
| PORS_tyhjana_mi1vr_0ei = 1 (%) | 14 ( 56.0) | 12 ( 66.7) | 0.697 | |
| Tuhoelmerkkeja_0kylla_1ei = 1 (%) | 7 ( 28.0) | 3 ( 16.7) | 0.616 | |
| kissoja0on1ei (%) | 0.962 | |||
| 0 | 15 ( 60.0) | 11 ( 61.1) | ||
| 0.5 | 1 ( 4.0) | 1 ( 5.6) | ||
| 1 | 9 ( 36.0) | 6 ( 33.3) | ||
| Kotielain_sikalaan_0kylla_1ei = 1 (%) | 21 ( 84.0) | 13 ( 72.2) | 0.578 | |
| Vesi_1kunn_0oma = 1 (%) | 18 ( 72.0) | 9 ( 50.0) | 0.249 | |
| ClC = 1 (%) | 1 ( 4.0) | 2 ( 11.1) | 0.767 | |
| ClA = 0 (%) | 25 (100.0) | 18 (100.0) | NA | |
| SI = 1 (%) | 0 ( 0.0) | 4 ( 22.2) | 0.052 | |
| APP = 1 (%) | 4 ( 16.0) | 1 ( 5.6) | 0.567 | |
| Loisaika_1ennenpors_2_porskars = 2 (%) | 10 ( 40.0) | 6 ( 33.3) | 0.899 | |
| Ton_tiheys_1aina_2jaetaan = 2 (%) | 3 ( 12.0) | 1 ( 5.6) | 0.853 | |
| Muutelkaynn_0ei_1_satunn_2kaynnmuusaann (%) | 0.082 | |||
| 0 | 10 ( 40.0) | 6 ( 33.3) | ||
| 1 | 14 ( 56.0) | 7 ( 38.9) | ||
| 2 | 1 ( 4.0) | 5 ( 27.8) | ||
| maitokuume = 1 (%) | 13 ( 52.0) | 9 ( 50.0) | 1.000 | |
| metriitti = 1 (%) | 9 ( 36.0) | 10 ( 55.6) | 0.336 | |
| valuttelu = 1 (%) | 1 ( 4.0) | 4 ( 22.2) | 0.175 | |
| mastiitti = 1 (%) | 6 ( 24.0) | 4 ( 22.2) | 1.000 | |
| ontuma = 1 (%) | 18 ( 72.0) | 13 ( 72.2) | 1.000 | |
| syomattomyys = 1 (%) | 12 ( 48.0) | 10 ( 55.6) | 0.857 | |
| kuume = 1 (%) | 2 ( 8.0) | 4 ( 22.2) | 0.378 | |
| loukkaantuminen = 1 (%) | 10 ( 40.0) | 6 ( 33.3) | 0.899 | |
| AB_rutiinilaak = 1 (%) | 2 ( 8.0) | 4 ( 22.2) | 0.378 | |
| Oksitosiini_rutiinisti = 1 (%) | 7 ( 28.0) | 10 ( 55.6) | 0.132 | |
| Kaynnistys_rutiinisti = 1 (%) | 0 ( 0.0) | 4 ( 22.2) | 0.052 | |
| NSAID_porsituksessa_rutiini = 1 (%) | 7 ( 28.0) | 3 ( 16.7) | 0.616 | |
| OMATENSIKOT_0EI_1KYLLa = 1 (%) | 19 ( 76.0) | 9 ( 50.0) | 0.150 | |
| Ensikk_yhdist_1ennsiem_2tiineena_3porsjalk_4tilantmuk (%) | 0.415 | |||
| 1 | 1 ( 4.0) | 0 ( 0.0) | ||
| 2 | 2 ( 8.0) | 3 ( 16.7) | ||
| 3 | 20 ( 80.0) | 15 ( 83.3) | ||
| 4 | 2 ( 8.0) | 0 ( 0.0) | ||
| Kiimantark_ryhmakaytt = 1 (%) | 24 ( 96.0) | 14 ( 77.8) | 0.175 | |
| Kiimantarkalkaa_vrkvier (%) | 0.242 | |||
| 0 | 5 ( 20.0) | 7 ( 38.9) | ||
| 1 | 15 ( 60.0) | 8 ( 44.4) | ||
| 3 | 3 ( 12.0) | 0 ( 0.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.6) | ||
| 5 | 2 ( 8.0) | 2 ( 11.1) | ||
| Kiimamerk_emakonselka = 1 (%) | 21 ( 84.0) | 16 ( 88.9) | 0.992 | |
| Kiimantark_postsiem = 1 (%) | 24 ( 96.0) | 17 ( 94.4) | 1.000 | |
| Postsiem_ryhmakaytt_havainnointi = 1 (%) | 21 ( 84.0) | 17 ( 94.4) | 0.567 | |
| Tiin_ultra2 (%) | 0.348 | |||
| 6 | 24 ( 96.0) | 17 ( 94.4) | ||
| 8 | 1 ( 4.0) | 0 ( 0.0) | ||
| 10 | 0 ( 0.0) | 1 ( 5.6) | ||
| Kaynnistaminen_0ei_1rutiini_2yliaika_3ryhma_4satunnainen (%) | 0.130 | |||
| 0 | 12 ( 48.0) | 4 ( 22.2) | ||
| 1 | 0 ( 0.0) | 2 ( 11.1) | ||
| 2 | 4 ( 16.0) | 4 ( 22.2) | ||
| 3 | 2 ( 8.0) | 0 ( 0.0) | ||
| 4 | 7 ( 28.0) | 8 ( 44.4) | ||
| Pesantekomatmaara_1runsas_2jnkv_3niukka (%) | 0.242 | |||
| 1 | 3 ( 12.0) | 0 ( 0.0) | ||
| 2 | 19 ( 76.0) | 14 ( 77.8) | ||
| 3 | 3 ( 12.0) | 4 ( 22.2) | ||
| PorsitusNSAID_0ei_1rutiinisti_2tarvittaessa = 2 (%) | 20 ( 80.0) | 15 ( 83.3) | 1.000 | |
| AS_maara123 (%) | 0.376 | |||
| 0 | 1 ( 4.0) | 0 ( 0.0) | ||
| 2 | 20 ( 80.0) | 17 ( 94.4) | ||
| 3 | 4 ( 16.0) | 1 ( 5.6) | ||
| AS_annostelu1234 (%) | 0.472 | |||
| 0 | 1 ( 4.0) | 1 ( 5.6) | ||
| 1 | 24 ( 96.0) | 16 ( 88.9) | ||
| 3 | 0 ( 0.0) | 1 ( 5.6) | ||
| AS_sairkars = 1 (%) | 6 ( 24.0) | 5 ( 27.8) | 1.000 | |
| AS_ruoklaite12345 = 4 (%) | 24 ( 96.0) | 17 ( 94.4) | 1.000 | |
| AS_ruokpaikka (%) | 0.470 | |||
| 0 | 1 ( 4.0) | 0 ( 0.0) | ||
| 1 | 23 ( 92.0) | 18 (100.0) | ||
| 4 | 1 ( 4.0) | 0 ( 0.0) | ||
| TII_alusta12345 = 1 (%) | 25 (100.0) | 18 (100.0) | NA | |
| TII_latt_rakenne1234 (%) | 0.662 | |||
| 1 | 3 ( 12.0) | 2 ( 11.1) | ||
| 12 | 2 ( 8.0) | 2 ( 11.1) | ||
| 13 | 20 ( 80.0) | 13 ( 72.2) | ||
| 23 | 0 ( 0.0) | 1 ( 5.6) | ||
| TII_kuiv_mat12345 (%) | 0.181 | |||
| 1 | 3 ( 12.0) | 2 ( 11.1) | ||
| 2 | 15 ( 60.0) | 16 ( 88.9) | ||
| 12 | 3 ( 12.0) | 0 ( 0.0) | ||
| 14 | 3 ( 12.0) | 0 ( 0.0) | ||
| 15 | 1 ( 4.0) | 0 ( 0.0) | ||
| TII_maara1234 (%) | 0.064 | |||
| 1 | 4 ( 16.0) | 0 ( 0.0) | ||
| 2 | 4 ( 16.0) | 1 ( 5.6) | ||
| 3 | 15 ( 60.0) | 10 ( 55.6) | ||
| 4 | 2 ( 8.0) | 6 ( 33.3) | ||
| 23 | 0 ( 0.0) | 1 ( 5.6) | ||
| TII_tonkimat_6_mika (%) | 0.577 | |||
| 1 | 22 ( 88.0) | 16 ( 88.9) | ||
| 2 | 1 ( 4.0) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.6) | ||
| 4 | 1 ( 4.0) | 0 ( 0.0) | ||
| 5 | 1 ( 4.0) | 1 ( 5.6) | ||
| TII_lelu1234 (%) | 0.308 | |||
| 2 | 2 ( 8.0) | 0 ( 0.0) | ||
| 4 | 22 ( 88.0) | 17 ( 94.4) | ||
| 5 | 1 ( 4.0) | 0 ( 0.0) | ||
| 24 | 0 ( 0.0) | 1 ( 5.6) | ||
| TII_maara123 (%) | 0.037 | |||
| 1 | 4 ( 16.0) | 0 ( 0.0) | ||
| 1.5 | 0 ( 0.0) | 2 ( 11.1) | ||
| 2 | 21 ( 84.0) | 14 ( 77.8) | ||
| 3 | 0 ( 0.0) | 2 ( 11.1) | ||
| TII_annostelu1234 (%) | 0.313 | |||
| 1 | 22 ( 88.0) | 18 (100.0) | ||
| 2 | 1 ( 4.0) | 0 ( 0.0) | ||
| 4 | 2 ( 8.0) | 0 ( 0.0) | ||
| TII_sairkars = 1 (%) | 24 ( 96.0) | 15 ( 83.3) | 0.380 | |
| POR_latt_rakenne1234 (%) | 0.443 | |||
| 1 | 2 ( 8.0) | 0 ( 0.0) | ||
| 2 | 2 ( 8.0) | 1 ( 5.6) | ||
| 12 | 20 ( 80.0) | 16 ( 88.9) | ||
| 13 | 0 ( 0.0) | 1 ( 5.6) | ||
| 123 | 1 ( 4.0) | 0 ( 0.0) | ||
| POR_maara1234 (%) | 0.448 | |||
| 2 | 6 ( 24.0) | 2 ( 11.1) | ||
| 3 | 15 ( 60.0) | 14 ( 77.8) | ||
| 4 | 4 ( 16.0) | 2 ( 11.1) | ||
| POR_tonkimat_6_mika (%) | 0.668 | |||
| 1 | 20 ( 80.0) | 16 ( 88.9) | ||
| 2 | 1 ( 4.0) | 0 ( 0.0) | ||
| 3 | 1 ( 4.0) | 0 ( 0.0) | ||
| 4 | 2 ( 8.0) | 2 ( 11.1) | ||
| 5 | 1 ( 4.0) | 0 ( 0.0) | ||
| POR_lelu1234 (%) | 0.537 | |||
| 2 | 0 ( 0.0) | 1 ( 5.6) | ||
| 3 | 1 ( 4.0) | 1 ( 5.6) | ||
| 4 | 23 ( 92.0) | 16 ( 88.9) | ||
| 5 | 1 ( 4.0) | 0 ( 0.0) | ||
| POR_mat_vaiht = 2 (%) | 1 ( 4.0) | 0 ( 0.0) | 1.000 | |
| POR_maara123 (%) | 0.121 | |||
| 1 | 2 ( 8.0) | 0 ( 0.0) | ||
| 2 | 23 ( 92.0) | 16 ( 88.9) | ||
| 3 | 0 ( 0.0) | 2 ( 11.1) | ||
| POR_annostelu1234 (%) | 0.827 | |||
| 1 | 21 ( 84.0) | 16 ( 88.9) | ||
| 2 | 2 ( 8.0) | 1 ( 5.6) | ||
| 3 | 1 ( 4.0) | 1 ( 5.6) | ||
| 4 | 1 ( 4.0) | 0 ( 0.0) | ||
| Koulmax_1peru_2ops_3a_4amk_5yl (%) | 0.220 | |||
| 2 | 3 ( 12.0) | 2 ( 11.1) | ||
| 3 | 19 ( 76.0) | 9 ( 50.0) | ||
| 4 | 2 ( 8.0) | 4 ( 22.2) | ||
| 5 | 1 ( 4.0) | 3 ( 16.7) | ||
| Stressi_1erpal_4jnkv (%) | 0.527 | |||
| 1 | 4 ( 16.0) | 2 ( 11.1) | ||
| 2 | 4 ( 16.0) | 4 ( 22.2) | ||
| 3 | 10 ( 40.0) | 4 ( 22.2) | ||
| 4 | 7 ( 28.0) | 8 ( 44.4) | ||
| EMKUOLLJAKO = 1 (%) | 8 ( 32.0) | 12 ( 66.7) | 0.053 | |
| EMPOISJAKO = 1 (%) | 9 ( 36.0) | 10 ( 55.6) | 0.336 | |
| EMENKUOLLJAKO = 1 (%) | 7 ( 28.0) | 11 ( 61.1) | 0.063 | |
| EMENPOISJAKO = 1 (%) | 6 ( 24.0) | 10 ( 55.6) | 0.073 | |
| NIVEL_01 = 2 (%) | 5 ( 20.0) | 13 ( 72.2) | 0.002 | |
| MAKUU01 = 2 (%) | 4 ( 16.0) | 14 ( 77.8) | <0.001 | |
| KOKO_01 = 2 (%) | 4 ( 16.0) | 14 ( 77.8) | <0.001 | |
| OSA_01 = 2 (%) | 4 ( 16.0) | 14 ( 77.8) | <0.001 | |
| JOKUHYLK_01 = 2 (%) | 0 ( 0.0) | 18 (100.0) | <0.001 | |
| PLEUR_01 = 1 (%) | 1 ( 4.0) | 11 ( 61.1) | <0.001 | |
| PNEUM_01 = 2 (%) | 5 ( 20.0) | 13 ( 72.2) | 0.002 | |
| SAIRKARS_AST_TII = 1 (%) | 19 ( 76.0) | 14 ( 77.8) | 1.000 |
res_mca = MCA(tilapieni, quanti.sup = c(1:16), graph = FALSE)
summary(res_mca)
##
## Call:
## MCA(X = tilapieni, quanti.sup = c(1:16), graph = FALSE)
##
##
## Eigenvalues
## Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 Dim.6
## Variance 0.125 0.094 0.089 0.087 0.078 0.074
## % of var. 7.586 5.695 5.398 5.287 4.767 4.503
## Cumulative % of var. 7.586 13.282 18.680 23.967 28.734 33.238
## Dim.7 Dim.8 Dim.9 Dim.10 Dim.11 Dim.12
## Variance 0.065 0.064 0.061 0.057 0.056 0.053
## % of var. 3.932 3.871 3.680 3.446 3.411 3.230
## Cumulative % of var. 37.169 41.040 44.720 48.166 51.576 54.806
## Dim.13 Dim.14 Dim.15 Dim.16 Dim.17 Dim.18
## Variance 0.052 0.047 0.047 0.046 0.042 0.041
## % of var. 3.155 2.875 2.834 2.782 2.528 2.472
## Cumulative % of var. 57.961 60.836 63.670 66.452 68.980 71.453
## Dim.19 Dim.20 Dim.21 Dim.22 Dim.23 Dim.24
## Variance 0.039 0.036 0.034 0.032 0.030 0.030
## % of var. 2.394 2.212 2.048 1.930 1.848 1.807
## Cumulative % of var. 73.847 76.059 78.107 80.036 81.885 83.692
## Dim.25 Dim.26 Dim.27 Dim.28 Dim.29 Dim.30
## Variance 0.027 0.025 0.023 0.022 0.018 0.018
## % of var. 1.658 1.542 1.386 1.351 1.115 1.092
## Cumulative % of var. 85.350 86.891 88.278 89.629 90.743 91.836
## Dim.31 Dim.32 Dim.33 Dim.34 Dim.35 Dim.36
## Variance 0.017 0.016 0.016 0.014 0.012 0.012
## % of var. 1.044 0.979 0.953 0.880 0.759 0.735
## Cumulative % of var. 92.880 93.859 94.811 95.691 96.451 97.186
## Dim.37 Dim.38 Dim.39 Dim.40 Dim.41 Dim.42
## Variance 0.011 0.009 0.008 0.007 0.006 0.005
## % of var. 0.657 0.523 0.476 0.430 0.395 0.332
## Cumulative % of var. 97.844 98.367 98.842 99.273 99.668 100.000
##
## Individuals (the 10 first)
## Dim.1 ctr cos2 Dim.2
## 1 | 0.208 0.808 0.031 | -0.072
## 2 | -0.413 3.179 0.075 | -0.312
## 3 | -0.345 2.216 0.040 | 1.056
## 4 | 0.096 0.173 0.011 | -0.052
## 5 | 0.600 6.713 0.234 | -0.039
## 6 | -0.217 0.880 0.047 | 0.028
## 7 | 0.302 1.699 0.093 | 0.049
## 8 | -0.265 1.312 0.029 | 0.426
## 9 | -0.471 4.134 0.081 | -0.446
## 10 | -0.019 0.006 0.000 | 0.052
## ctr cos2 Dim.3 ctr
## 1 0.129 0.004 | 0.070 0.129
## 2 2.423 0.043 | 0.214 1.195
## 3 27.707 0.374 | 0.339 3.002
## 4 0.068 0.003 | 0.063 0.104
## 5 0.037 0.001 | -0.060 0.096
## 6 0.020 0.001 | -0.011 0.003
## 7 0.060 0.002 | 0.054 0.077
## 8 4.510 0.075 | -1.002 26.273
## 9 4.937 0.073 | 0.566 8.383
## 10 0.068 0.002 | -0.363 3.451
## cos2
## 1 0.004 |
## 2 0.020 |
## 3 0.038 |
## 4 0.005 |
## 5 0.002 |
## 6 0.000 |
## 7 0.003 |
## 8 0.415 |
## 9 0.117 |
## 10 0.099 |
##
## Categories (the 10 first)
## Dim.1 ctr cos2 v.test
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_1 | -0.229 0.129 0.016 -0.817 |
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_2 | 0.013 0.001 0.000 0.111 |
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_3 | 0.387 0.184 0.020 0.911 |
## Tuotsuunta_1 | 0.166 0.149 0.029 1.101 |
## Tuotsuunta_2 | -0.174 0.156 0.029 -1.101 |
## Tautsu_012_0 | -0.324 0.335 0.046 -1.383 |
## Tautsu_012_1 | 0.295 0.278 0.038 1.260 |
## Tautsu_012_2 | 0.022 0.002 0.000 0.115 |
## PORSOSASTO_kertayt_0ei_0 | -0.388 0.925 0.210 -2.967 |
## PORSOSASTO_kertayt_0ei_1 | 0.540 1.285 0.210 2.967 |
## Dim.2 ctr cos2 v.test
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_1 0.435 0.617 0.057 1.551 |
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_2 -0.171 0.269 0.055 -1.518 |
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_3 0.091 0.014 0.001 0.214 |
## Tuotsuunta_1 -0.121 0.105 0.015 -0.803 |
## Tuotsuunta_2 0.127 0.110 0.015 0.803 |
## Tautsu_012_0 0.068 0.019 0.002 0.289 |
## Tautsu_012_1 -0.190 0.153 0.016 -0.809 |
## Tautsu_012_2 0.093 0.048 0.006 0.488 |
## PORSOSASTO_kertayt_0ei_0 0.095 0.074 0.013 0.729 |
## PORSOSASTO_kertayt_0ei_1 -0.133 0.103 0.013 -0.729 |
## Dim.3 ctr cos2 v.test
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_1 0.569 1.115 0.098 2.029 |
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_2 -0.136 0.179 0.035 -1.206 |
## Haastrooli_1OmEiosall_2OmOsall_3Esimies_3 -0.375 0.242 0.018 -0.881 |
## Tuotsuunta_1 -0.163 0.201 0.028 -1.080 |
## Tuotsuunta_2 0.171 0.211 0.028 1.080 |
## Tautsu_012_0 -0.253 0.288 0.028 -1.081 |
## Tautsu_012_1 -0.027 0.003 0.000 -0.116 |
## Tautsu_012_2 0.215 0.270 0.030 1.124 |
## PORSOSASTO_kertayt_0ei_0 -0.047 0.019 0.003 -0.359 |
## PORSOSASTO_kertayt_0ei_1 0.065 0.026 0.003 0.359 |
##
## Categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## Haastrooli_1OmEiosall_2OmOsall_3Esimies | 0.030 0.064 0.104 |
## Tuotsuunta | 0.029 0.015 0.028 |
## Tautsu_012 | 0.058 0.016 0.038 |
## PORSOSASTO_kertayt_0ei | 0.210 0.013 0.003 |
## PORS_pesu_0ei | 0.004 0.001 0.085 |
## PORS_desinf_0ei_1LIU_2KUIVA | 0.027 0.019 0.205 |
## PORS_tyhjana_mi1vr_0ei | 0.000 0.245 0.003 |
## Tuhoelmerkkeja_0kylla_1ei | 0.036 0.072 0.020 |
## kissoja0on1ei | 0.111 0.059 0.068 |
## Kotielain_sikalaan_0kylla_1ei | 0.044 0.015 0.009 |
##
## Supplementary continuous variables (the 10 first)
## Dim.1 Dim.2 Dim.3
## Karjut_astsiem | 0.182 | 0.027 | -0.002 |
## emakot | 0.611 | 0.015 | -0.039 |
## ensikot | 0.427 | -0.011 | -0.039 |
## lihasiat | 0.139 | -0.004 | 0.040 |
## karjut | 0.463 | -0.012 | 0.104 |
## kokemusave | -0.270 | -0.138 | -0.144 |
## kokemusmax | -0.116 | -0.148 | -0.124 |
## emakoitaper | 0.509 | 0.033 | -0.059 |
## nivelpros | 0.228 | 0.074 | 0.065 |
## paisepros | 0.536 | 0.078 | 0.151 |
To visualize the percentage of inertia explained by each MCA dimension:
eig.val <- res_mca$eig
barplot(eig.val[, 2],
names.arg = 1:nrow(eig.val),
main = "Variances Explained by Dimensions (%)",
xlab = "Principal Dimensions",
ylab = "Percentage of variances",
col ="steelblue")
# Add connected line segments to the plot
lines(x = 1:nrow(eig.val), eig.val[, 2],
type = "b", pch = 19, col = "red")
fviz_mca_var(res_mca, choice = "mca.cor",
repel = TRUE, # Avoid text overlapping (slow)
ggtheme = theme_minimal())
To visualize the percentage of inertia explained by each MCA dimension:
fviz_mca_var(res_mca, col.var = "contrib",
gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
repel = TRUE, # avoid text overlapping (slow)
ggtheme = theme_minimal()
)
Simple bar plots can also be used to visualize contribution of variable categories. The top 12 variable categories contributing to the first and second dimension:
# Contributions of rows to dimension 1
fviz_contrib(res_mca, choice = "var", axes = 1, top = 12)
# Contributions of rows to dimension 2
fviz_contrib(res_mca, choice = "var", axes = 2, top = 12)
# load data
setwd("~/GitHub/tilataso")
library(readr)
library(FactoMineR)
library(FactoInvestigate)
library(factoextra)
library(dplyr)
library(explor)
med<-read.csv(file="med.csv", header=TRUE)
med<-med%>%mutate_all(as.factor)
med[,33]<-as.numeric(med[,33])
med[,35]<-as.numeric(med[,35])
medcat<-med[,1:32]
mednum<-med[,c(33,35)]
colnames(medcat[,1:30])
## [1] "M_parasperyear" "M_parasot_1before_2inFAR_3noinfo"
## [3] "M_induction_0never_1sometimes" "M_milkfever"
## [5] "M_metritis" "M_secr"
## [7] "M_mastitis" "M_lame"
## [9] "M_anorex" "M_fever"
## [11] "M_injury" "M_pregNSAIDS100"
## [13] "M_pregAB100" "M_farNSAIDS100"
## [15] "M_farAB100" "M_routine_0no_1yes"
## [17] "M_routine_medic" "M_rAB"
## [19] "M_rOX" "M_rIND"
## [21] "M_rFARNSAIDS" "M_Farind_0no_1rout_2sometimes"
## [23] "M_OX_10far" "M_obstex_preOX"
## [25] "M_Oxdosage" "M_OX_between"
## [27] "M_Oxmax" "M_far_assist_CAT"
## [29] "M_far_assist" "M_farNSAIDS_0no_1rout_2ifneed"
library(tidyr)
gather(medcat[,1:30]) %>% ggplot(aes(value)) + facet_wrap("key", scales = "free") + geom_bar(fill="purple") + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8))+ scale_fill_manual("key")
colnames(medcat[,31:32])
## [1] "M_lameness" "M_AB_effectave"
library(tidyr)
gather(medcat[,31:32]) %>% ggplot(aes(value)) + facet_wrap("key", scales = "free") + geom_bar(fill="purple") + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8))+ scale_fill_manual("key")
library(dplyr)
library(ggplot2)
out<-med %>% dplyr::select(ends_with("pro"))
#Matrix of plots
ggpairs(out, lower = list(combo = wrap("facethist", bins = 20)), title="Graphical overview of the 2 outcome variables")
library(tableone)
KreateTableOne = function(x, ...){
t1 = tableone::CreateTableOne(data=x, ...)
t2 = print(t1, quote=TRUE)
rownames(t2) = gsub(pattern='\\"', replacement='', rownames(t2))
colnames(t2) = gsub(pattern='\\"', replacement='', colnames(t2))
return(t2)
}
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table1 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWmortdic')
table1%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow mortality") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 23 | 20 | ||
| M_parasperyear (%) | 0.322 | |||
| 0 | 0 ( 0.0) | 2 ( 10.0) | ||
| 1 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 2 ( 8.7) | 1 ( 5.0) | ||
| 2,1 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2,2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2,3 | 8 (34.8) | 7 ( 35.0) | ||
| 2,4 | 11 (47.8) | 7 ( 35.0) | ||
| 4 | 0 ( 0.0) | 2 ( 10.0) | ||
| M_parasot_1before_2inFAR_3noinfo (%) | 0.954 | |||
| 1 | 10 (43.5) | 9 ( 45.0) | ||
| 2 | 9 (39.1) | 7 ( 35.0) | ||
| 3 | 4 (17.4) | 4 ( 20.0) | ||
| M_induction_0never_1sometimes (%) | 0.433 | |||
| 0 | 10 (43.5) | 6 ( 31.6) | ||
| 1 | 12 (52.2) | 13 ( 68.4) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| M_milkfever = 1 (%) | 12 (52.2) | 10 ( 50.0) | 1.000 | |
| M_metritis = 1 (%) | 10 (43.5) | 9 ( 45.0) | 1.000 | |
| M_secr = 1 (%) | 2 ( 8.7) | 3 ( 15.0) | 0.868 | |
| M_mastitis = 1 (%) | 4 (17.4) | 6 ( 30.0) | 0.539 | |
| M_lame = 1 (%) | 15 (65.2) | 16 ( 80.0) | 0.461 | |
| M_anorex = 1 (%) | 10 (43.5) | 12 ( 60.0) | 0.438 | |
| M_fever = 1 (%) | 2 ( 8.7) | 4 ( 20.0) | 0.531 | |
| M_injury = 1 (%) | 10 (43.5) | 6 ( 30.0) | 0.551 | |
| M_pregNSAIDS100 (%) | 0.474 | |||
| 1 ( 4.3) | 1 ( 5.0) | |||
| 0 | 10 (43.5) | 5 ( 25.0) | ||
| 0,1 | 0 ( 0.0) | 1 ( 5.0) | ||
| 0,2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 0,25 | 1 ( 4.3) | 3 ( 15.0) | ||
| 0,5 | 3 (13.0) | 3 ( 15.0) | ||
| 0,6 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 3 (13.0) | 4 ( 20.0) | ||
| 1,5 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 2 ( 8.7) | 0 ( 0.0) | ||
| 2,5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3,5 | 1 ( 4.3) | 0 ( 0.0) | ||
| M_pregAB100 (%) | 0.507 | |||
| 1 ( 4.3) | 1 ( 5.0) | |||
| 0 | 9 (39.1) | 5 ( 25.0) | ||
| 0,2 | 0 ( 0.0) | 2 ( 10.0) | ||
| 0,25 | 1 ( 4.3) | 1 ( 5.0) | ||
| 0,5 | 3 (13.0) | 4 ( 20.0) | ||
| 0,75 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1 | 4 (17.4) | 3 ( 15.0) | ||
| 1,5 | 1 ( 4.3) | 3 ( 15.0) | ||
| 10 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2 | 2 ( 8.7) | 0 ( 0.0) | ||
| 2,5 | 1 ( 4.3) | 0 ( 0.0) | ||
| M_farNSAIDS100 (%) | 0.311 | |||
| 1 ( 4.3) | 1 ( 5.0) | |||
| 0 | 3 (13.0) | 1 ( 5.0) | ||
| 0,5 | 2 ( 8.7) | 0 ( 0.0) | ||
| 1 | 0 ( 0.0) | 3 ( 15.0) | ||
| 10 | 1 ( 4.3) | 2 ( 10.0) | ||
| 100 | 4 (17.4) | 1 ( 5.0) | ||
| 15 | 1 ( 4.3) | 0 ( 0.0) | ||
| 18 | 2 ( 8.7) | 0 ( 0.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2,5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 20 | 1 ( 4.3) | 0 ( 0.0) | ||
| 25 | 1 ( 4.3) | 0 ( 0.0) | ||
| 28 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 30 | 0 ( 0.0) | 1 ( 5.0) | ||
| 35 | 0 ( 0.0) | 1 ( 5.0) | ||
| 40 | 0 ( 0.0) | 2 ( 10.0) | ||
| 5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 50 | 1 ( 4.3) | 2 ( 10.0) | ||
| 6 | 2 ( 8.7) | 1 ( 5.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.0) | ||
| 8 | 1 ( 4.3) | 0 ( 0.0) | ||
| 90 | 0 ( 0.0) | 1 ( 5.0) | ||
| M_farAB100 (%) | 0.624 | |||
| 1 ( 4.3) | 2 ( 10.0) | |||
| 0 | 3 (13.0) | 0 ( 0.0) | ||
| 0,25 | 1 ( 4.3) | 0 ( 0.0) | ||
| 0,5 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1 | 1 ( 4.3) | 4 ( 20.0) | ||
| 10 | 3 (13.0) | 1 ( 5.0) | ||
| 100 | 1 ( 4.3) | 0 ( 0.0) | ||
| 12 | 1 ( 4.3) | 1 ( 5.0) | ||
| 15 | 0 ( 0.0) | 1 ( 5.0) | ||
| 18 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 1 ( 4.3) | 1 ( 5.0) | ||
| 2,5 | 0 ( 0.0) | 1 ( 5.0) | ||
| 20 | 0 ( 0.0) | 1 ( 5.0) | ||
| 25 | 0 ( 0.0) | 1 ( 5.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| 3,5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 30 | 0 ( 0.0) | 1 ( 5.0) | ||
| 4,5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 5 | 2 ( 8.7) | 0 ( 0.0) | ||
| 6 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.0) | ||
| 7,5 | 2 ( 8.7) | 1 ( 5.0) | ||
| 8 | 1 ( 4.3) | 1 ( 5.0) | ||
| M_routine_0no_1yes = 1 (%) | 15 (65.2) | 13 ( 65.0) | 1.000 | |
| M_routine_medic (%) | 0.265 | |||
| _COC | 1 ( 4.3) | 0 ( 0.0) | ||
| _FARNSAIDS | 3 (13.0) | 2 ( 10.0) | ||
| _FARNSAIDS_COC | 1 ( 4.3) | 0 ( 0.0) | ||
| _FARNSAIDS_PPAB | 0 ( 0.0) | 1 ( 5.0) | ||
| _PPAB | 1 ( 4.3) | 1 ( 5.0) | ||
| no | 9 (39.1) | 7 ( 35.0) | ||
| OX | 6 (26.1) | 3 ( 15.0) | ||
| OX_FARNSAIDS | 2 ( 8.7) | 0 ( 0.0) | ||
| OX_FARNSAIDS_COC_PPAB | 0 ( 0.0) | 1 ( 5.0) | ||
| OX_IND | 0 ( 0.0) | 4 ( 20.0) | ||
| OX_PPAB | 0 ( 0.0) | 1 ( 5.0) | ||
| M_rAB = 1 (%) | 2 ( 8.7) | 4 ( 20.0) | 0.531 | |
| M_rOX = 1 (%) | 8 (34.8) | 9 ( 45.0) | 0.711 | |
| M_rIND = 1 (%) | 0 ( 0.0) | 4 ( 20.0) | 0.084 | |
| M_rFARNSAIDS = 1 (%) | 6 (26.1) | 4 ( 20.0) | 0.913 | |
| M_Farind_0no_1rout_2sometimes (%) | 0.292 | |||
| 0 | 10 (43.5) | 7 ( 35.0) | ||
| 1 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2 | 13 (56.5) | 10 ( 50.0) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.0) | ||
| M_OX_10far (%) | 0.335 | |||
| 0 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1 | 3 (13.0) | 2 ( 10.0) | ||
| 10 | 3 (13.0) | 6 ( 30.0) | ||
| 2 | 3 (13.0) | 3 ( 15.0) | ||
| 3 | 3 (13.0) | 3 ( 15.0) | ||
| 4 | 2 ( 8.7) | 0 ( 0.0) | ||
| 5 | 3 (13.0) | 0 ( 0.0) | ||
| 6 | 0 ( 0.0) | 1 ( 5.0) | ||
| 7 | 0 ( 0.0) | 2 ( 10.0) | ||
| 8 | 1 ( 4.3) | 0 ( 0.0) | ||
| 9 | 3 (13.0) | 1 ( 5.0) | ||
| noinfo | 1 ( 4.3) | 2 ( 10.0) | ||
| M_obstex_preOX (%) | 0.196 | |||
| 0 | 16 (69.6) | 10 ( 50.0) | ||
| 1 | 7 (30.4) | 8 ( 40.0) | ||
| noinfo | 0 ( 0.0) | 2 ( 10.0) | ||
| M_Oxdosage (%) | 0.417 | |||
| 0,3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 0,4 | 1 ( 4.3) | 0 ( 0.0) | ||
| 0,5 | 4 (17.4) | 2 ( 10.0) | ||
| 0,8 | 6 (26.1) | 2 ( 10.0) | ||
| 1 | 8 (34.8) | 9 ( 45.0) | ||
| 1,3 | 1 ( 4.3) | 2 ( 10.0) | ||
| 1,5 | 2 ( 8.7) | 0 ( 0.0) | ||
| 1,8 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| noinfo | 1 ( 4.3) | 2 ( 10.0) | ||
| M_OX_between (%) | 0.321 | |||
| 0,5 | 7 (30.4) | 7 ( 35.0) | ||
| 0,75 | 5 (21.7) | 0 ( 0.0) | ||
| 0,8 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 5 (21.7) | 6 ( 30.0) | ||
| 1,25 | 2 ( 8.7) | 1 ( 5.0) | ||
| 1,75 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2,5 | 1 ( 4.3) | 1 ( 5.0) | ||
| noinfo | 2 ( 8.7) | 2 ( 10.0) | ||
| M_Oxmax (%) | 0.885 | |||
| 2 | 4 (17.4) | 2 ( 10.0) | ||
| 2,5 | 3 (13.0) | 3 ( 15.0) | ||
| 3 | 6 (26.1) | 6 ( 30.0) | ||
| 3,5 | 2 ( 8.7) | 3 ( 15.0) | ||
| 4 | 3 (13.0) | 1 ( 5.0) | ||
| 5 | 1 ( 4.3) | 2 ( 10.0) | ||
| 8 | 1 ( 4.3) | 0 ( 0.0) | ||
| noinfo | 3 (13.0) | 3 ( 15.0) | ||
| M_far_assist_CAT (%) | 0.161 | |||
| <6 | 4 (17.4) | 7 ( 35.0) | ||
| 10 | 1 ( 4.3) | 0 ( 0.0) | ||
| 15 | 0 ( 0.0) | 1 ( 5.0) | ||
| 20-50 | 4 (17.4) | 4 ( 20.0) | ||
| 50 | 3 (13.0) | 1 ( 5.0) | ||
| 6-20 | 10 (43.5) | 3 ( 15.0) | ||
| noinfo | 1 ( 4.3) | 4 ( 20.0) | ||
| M_far_assist (%) | 0.168 | |||
| 1 | 3 (13.0) | 1 ( 5.0) | ||
| 10 | 8 (34.8) | 1 ( 5.0) | ||
| 15 | 3 (13.0) | 3 ( 15.0) | ||
| 20 | 3 (13.0) | 2 ( 10.0) | ||
| 25 | 1 ( 4.3) | 1 ( 5.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 35 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 1 ( 4.3) | 4 ( 20.0) | ||
| 50 | 3 (13.0) | 1 ( 5.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.0) | ||
| noinfo | 1 ( 4.3) | 4 ( 20.0) | ||
| M_farNSAIDS_0no_1rout_2ifneed (%) | 0.972 | |||
| 1 | 4 (17.4) | 4 ( 20.0) | ||
| 2 | 14 (60.9) | 12 ( 60.0) | ||
| noinfo | 5 (21.7) | 4 ( 20.0) | ||
| M_lameness (%) | 0.249 | |||
| _PEN | 0 ( 0.0) | 1 ( 5.0) | ||
| 0 | 9 (39.1) | 5 ( 25.0) | ||
| 3 | 0 ( 0.0) | 2 ( 10.0) | ||
| NSAIDS | 1 ( 4.3) | 1 ( 5.0) | ||
| NSAIDS_AMOX | 1 ( 4.3) | 0 ( 0.0) | ||
| NSAIDS_PEN | 10 (43.5) | 4 ( 20.0) | ||
| NSAIDS_PEN_AMOX | 0 ( 0.0) | 2 ( 10.0) | ||
| NSAIDS_PEN_SEL | 0 ( 0.0) | 1 ( 5.0) | ||
| NSAIDS_PEN_TRIM | 0 ( 0.0) | 1 ( 5.0) | ||
| NSAIDS_TETR | 0 ( 0.0) | 1 ( 5.0) | ||
| NSAIDS3 | 2 ( 8.7) | 2 ( 10.0) | ||
| M_AB_effectave (%) | 0.597 | |||
| 0 ( 0.0) | 1 ( 5.0) | |||
| 1,33 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1,5 | 1 ( 4.3) | 0 ( 0.0) | ||
| 1,67 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2 | 5 (21.7) | 4 ( 20.0) | ||
| 2,25 | 1 ( 4.3) | 2 ( 10.0) | ||
| 2,33 | 2 ( 8.7) | 3 ( 15.0) | ||
| 2,5 | 3 (13.0) | 0 ( 0.0) | ||
| 2,67 | 2 ( 8.7) | 2 ( 10.0) | ||
| 2,75 | 1 ( 4.3) | 0 ( 0.0) | ||
| 2,86 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 4 (17.4) | 6 ( 30.0) | ||
| 4 | 2 ( 8.7) | 1 ( 5.0) | ||
| OUT_SOWmortpro (mean (sd)) | 4.74 (2.12) | 13.35 (3.27) | <0.001 | |
| OUT_SOWmortdic = 1 (%) | 0 ( 0.0) | 20 (100.0) | <0.001 | |
| OUT_SOWcullpro (mean (sd)) | 8.81 (6.62) | 17.89 (6.29) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 5 (23.8) | 14 ( 77.8) | 0.002 | |
| OUT_JOKUHYLK_01 = 2 (%) | 6 (31.6) | 12 ( 66.7) | 0.071 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table2 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWculldic')
table2%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow cull") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 20 | 19 | ||
| M_parasperyear (%) | 0.437 | |||
| 0 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2 | 2 (10.0) | 1 ( 5.3) | ||
| 2,1 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2,2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 2,3 | 6 (30.0) | 7 ( 36.8) | ||
| 2,4 | 10 (50.0) | 7 ( 36.8) | ||
| 4 | 0 ( 0.0) | 2 ( 10.5) | ||
| M_parasot_1before_2inFAR_3noinfo (%) | 0.613 | |||
| 1 | 10 (50.0) | 9 ( 47.4) | ||
| 2 | 6 (30.0) | 8 ( 42.1) | ||
| 3 | 4 (20.0) | 2 ( 10.5) | ||
| M_induction_0never_1sometimes (%) | 0.363 | |||
| 0 | 8 (40.0) | 5 ( 26.3) | ||
| 1 | 11 (55.0) | 14 ( 73.7) | ||
| 2 | 1 ( 5.0) | 0 ( 0.0) | ||
| M_milkfever = 1 (%) | 9 (45.0) | 10 ( 52.6) | 0.876 | |
| M_metritis = 1 (%) | 9 (45.0) | 9 ( 47.4) | 1.000 | |
| M_secr = 1 (%) | 3 (15.0) | 2 ( 10.5) | 1.000 | |
| M_mastitis = 1 (%) | 4 (20.0) | 5 ( 26.3) | 0.930 | |
| M_lame = 1 (%) | 13 (65.0) | 16 ( 84.2) | 0.314 | |
| M_anorex = 1 (%) | 11 (55.0) | 8 ( 42.1) | 0.628 | |
| M_fever = 1 (%) | 4 (20.0) | 1 ( 5.3) | 0.370 | |
| M_injury = 1 (%) | 8 (40.0) | 5 ( 26.3) | 0.571 | |
| M_pregNSAIDS100 (%) | 0.664 | |||
| 1 ( 5.0) | 1 ( 5.3) | |||
| 0 | 7 (35.0) | 5 ( 26.3) | ||
| 0,1 | 0 ( 0.0) | 1 ( 5.3) | ||
| 0,2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 0,25 | 1 ( 5.0) | 3 ( 15.8) | ||
| 0,5 | 3 (15.0) | 3 ( 15.8) | ||
| 0,6 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 4 (20.0) | 3 ( 15.8) | ||
| 1,5 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2,5 | 0 ( 0.0) | 1 ( 5.3) | ||
| 3 | 1 ( 5.0) | 0 ( 0.0) | ||
| 3,5 | 1 ( 5.0) | 0 ( 0.0) | ||
| M_pregAB100 (%) | 0.678 | |||
| 1 ( 5.0) | 1 ( 5.3) | |||
| 0 | 5 (25.0) | 6 ( 31.6) | ||
| 0,2 | 0 ( 0.0) | 2 ( 10.5) | ||
| 0,25 | 1 ( 5.0) | 1 ( 5.3) | ||
| 0,5 | 3 (15.0) | 4 ( 21.1) | ||
| 0,75 | 1 ( 5.0) | 0 ( 0.0) | ||
| 1 | 5 (25.0) | 2 ( 10.5) | ||
| 1,5 | 2 (10.0) | 2 ( 10.5) | ||
| 10 | 0 ( 0.0) | 1 ( 5.3) | ||
| 2 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2,5 | 1 ( 5.0) | 0 ( 0.0) | ||
| M_farNSAIDS100 (%) | NaN | |||
| 1 ( 5.0) | 1 ( 5.3) | |||
| 0 | 2 (10.0) | 1 ( 5.3) | ||
| 0,5 | 1 ( 5.0) | 1 ( 5.3) | ||
| 1 | 1 ( 5.0) | 2 ( 10.5) | ||
| 10 | 1 ( 5.0) | 2 ( 10.5) | ||
| 100 | 3 (15.0) | 1 ( 5.3) | ||
| 15 | 1 ( 5.0) | 0 ( 0.0) | ||
| 18 | 2 (10.0) | 0 ( 0.0) | ||
| 2 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2,5 | 0 ( 0.0) | 0 ( 0.0) | ||
| 20 | 0 ( 0.0) | 1 ( 5.3) | ||
| 25 | 1 ( 5.0) | 0 ( 0.0) | ||
| 28 | 1 ( 5.0) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 30 | 1 ( 5.0) | 0 ( 0.0) | ||
| 35 | 0 ( 0.0) | 1 ( 5.3) | ||
| 40 | 0 ( 0.0) | 2 ( 10.5) | ||
| 5 | 0 ( 0.0) | 2 ( 10.5) | ||
| 50 | 1 ( 5.0) | 1 ( 5.3) | ||
| 6 | 1 ( 5.0) | 2 ( 10.5) | ||
| 7 | 1 ( 5.0) | 0 ( 0.0) | ||
| 8 | 1 ( 5.0) | 0 ( 0.0) | ||
| 90 | 0 ( 0.0) | 1 ( 5.3) | ||
| M_farAB100 (%) | NaN | |||
| 1 ( 5.0) | 2 ( 10.5) | |||
| 0 | 2 (10.0) | 1 ( 5.3) | ||
| 0,25 | 0 ( 0.0) | 1 ( 5.3) | ||
| 0,5 | 1 ( 5.0) | 0 ( 0.0) | ||
| 1 | 3 (15.0) | 1 ( 5.3) | ||
| 10 | 2 (10.0) | 1 ( 5.3) | ||
| 100 | 1 ( 5.0) | 0 ( 0.0) | ||
| 12 | 2 (10.0) | 0 ( 0.0) | ||
| 15 | 0 ( 0.0) | 1 ( 5.3) | ||
| 18 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2 | 1 ( 5.0) | 1 ( 5.3) | ||
| 2,5 | 0 ( 0.0) | 0 ( 0.0) | ||
| 20 | 0 ( 0.0) | 1 ( 5.3) | ||
| 25 | 0 ( 0.0) | 1 ( 5.3) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 3,5 | 1 ( 5.0) | 1 ( 5.3) | ||
| 30 | 1 ( 5.0) | 0 ( 0.0) | ||
| 4,5 | 1 ( 5.0) | 1 ( 5.3) | ||
| 5 | 1 ( 5.0) | 1 ( 5.3) | ||
| 6 | 0 ( 0.0) | 1 ( 5.3) | ||
| 7 | 0 ( 0.0) | 1 ( 5.3) | ||
| 7,5 | 1 ( 5.0) | 2 ( 10.5) | ||
| 8 | 1 ( 5.0) | 1 ( 5.3) | ||
| M_routine_0no_1yes = 1 (%) | 12 (60.0) | 14 ( 73.7) | 0.571 | |
| M_routine_medic (%) | 0.430 | |||
| _COC | 1 ( 5.0) | 0 ( 0.0) | ||
| _FARNSAIDS | 2 (10.0) | 2 ( 10.5) | ||
| _FARNSAIDS_COC | 1 ( 5.0) | 0 ( 0.0) | ||
| _FARNSAIDS_PPAB | 0 ( 0.0) | 1 ( 5.3) | ||
| _PPAB | 1 ( 5.0) | 1 ( 5.3) | ||
| no | 9 (45.0) | 5 ( 26.3) | ||
| OX | 4 (20.0) | 4 ( 21.1) | ||
| OX_FARNSAIDS | 1 ( 5.0) | 1 ( 5.3) | ||
| OX_FARNSAIDS_COC_PPAB | 1 ( 5.0) | 0 ( 0.0) | ||
| OX_IND | 0 ( 0.0) | 4 ( 21.1) | ||
| OX_PPAB | 0 ( 0.0) | 1 ( 5.3) | ||
| M_rAB = 1 (%) | 3 (15.0) | 3 ( 15.8) | 1.000 | |
| M_rOX = 1 (%) | 6 (30.0) | 10 ( 52.6) | 0.267 | |
| M_rIND = 1 (%) | 0 ( 0.0) | 4 ( 21.1) | 0.101 | |
| M_rFARNSAIDS = 1 (%) | 5 (25.0) | 4 ( 21.1) | 1.000 | |
| M_Farind_0no_1rout_2sometimes (%) | 0.324 | |||
| 0 | 8 (40.0) | 7 ( 36.8) | ||
| 1 | 0 ( 0.0) | 2 ( 10.5) | ||
| 2 | 12 (60.0) | 9 ( 47.4) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.3) | ||
| M_OX_10far (%) | 0.221 | |||
| 0 | 1 ( 5.0) | 0 ( 0.0) | ||
| 1 | 2 (10.0) | 1 ( 5.3) | ||
| 10 | 4 (20.0) | 5 ( 26.3) | ||
| 2 | 1 ( 5.0) | 4 ( 21.1) | ||
| 3 | 4 (20.0) | 2 ( 10.5) | ||
| 4 | 1 ( 5.0) | 1 ( 5.3) | ||
| 5 | 2 (10.0) | 1 ( 5.3) | ||
| 6 | 1 ( 5.0) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 2 ( 10.5) | ||
| 8 | 0 ( 0.0) | 1 ( 5.3) | ||
| 9 | 4 (20.0) | 0 ( 0.0) | ||
| noinfo | 0 ( 0.0) | 2 ( 10.5) | ||
| M_obstex_preOX (%) | 0.263 | |||
| 0 | 12 (60.0) | 12 ( 63.2) | ||
| 1 | 8 (40.0) | 5 ( 26.3) | ||
| noinfo | 0 ( 0.0) | 2 ( 10.5) | ||
| M_Oxdosage (%) | 0.555 | |||
| 0,3 | 1 ( 5.0) | 0 ( 0.0) | ||
| 0,4 | 1 ( 5.0) | 0 ( 0.0) | ||
| 0,5 | 3 (15.0) | 2 ( 10.5) | ||
| 0,8 | 5 (25.0) | 2 ( 10.5) | ||
| 1 | 8 (40.0) | 8 ( 42.1) | ||
| 1,3 | 0 ( 0.0) | 2 ( 10.5) | ||
| 1,5 | 1 ( 5.0) | 1 ( 5.3) | ||
| 1,8 | 0 ( 0.0) | 1 ( 5.3) | ||
| 2 | 0 ( 0.0) | 1 ( 5.3) | ||
| noinfo | 1 ( 5.0) | 2 ( 10.5) | ||
| M_OX_between (%) | 0.595 | |||
| 0,5 | 5 (25.0) | 7 ( 36.8) | ||
| 0,75 | 3 (15.0) | 1 ( 5.3) | ||
| 0,8 | 1 ( 5.0) | 0 ( 0.0) | ||
| 1 | 7 (35.0) | 4 ( 21.1) | ||
| 1,25 | 1 ( 5.0) | 2 ( 10.5) | ||
| 1,75 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 2,5 | 1 ( 5.0) | 1 ( 5.3) | ||
| noinfo | 1 ( 5.0) | 3 ( 15.8) | ||
| M_Oxmax (%) | 0.413 | |||
| 2 | 2 (10.0) | 3 ( 15.8) | ||
| 2,5 | 4 (20.0) | 2 ( 10.5) | ||
| 3 | 4 (20.0) | 5 ( 26.3) | ||
| 3,5 | 2 (10.0) | 3 ( 15.8) | ||
| 4 | 4 (20.0) | 0 ( 0.0) | ||
| 5 | 1 ( 5.0) | 2 ( 10.5) | ||
| 8 | 1 ( 5.0) | 0 ( 0.0) | ||
| noinfo | 2 (10.0) | 4 ( 21.1) | ||
| M_far_assist_CAT (%) | 0.025 | |||
| <6 | 1 ( 5.0) | 8 ( 42.1) | ||
| 10 | 0 ( 0.0) | 1 ( 5.3) | ||
| 15 | 1 ( 5.0) | 0 ( 0.0) | ||
| 20-50 | 6 (30.0) | 2 ( 10.5) | ||
| 50 | 3 (15.0) | 1 ( 5.3) | ||
| 6-20 | 8 (40.0) | 3 ( 15.8) | ||
| noinfo | 1 ( 5.0) | 4 ( 21.1) | ||
| M_far_assist (%) | 0.156 | |||
| 1 | 1 ( 5.0) | 3 ( 15.8) | ||
| 10 | 4 (20.0) | 3 ( 15.8) | ||
| 15 | 5 (25.0) | 1 ( 5.3) | ||
| 20 | 4 (20.0) | 1 ( 5.3) | ||
| 25 | 1 ( 5.0) | 1 ( 5.3) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 35 | 1 ( 5.0) | 0 ( 0.0) | ||
| 5 | 0 ( 0.0) | 3 ( 15.8) | ||
| 50 | 3 (15.0) | 1 ( 5.3) | ||
| 7 | 0 ( 0.0) | 1 ( 5.3) | ||
| noinfo | 1 ( 5.0) | 4 ( 21.1) | ||
| M_farNSAIDS_0no_1rout_2ifneed (%) | 0.991 | |||
| 1 | 4 (20.0) | 4 ( 21.1) | ||
| 2 | 12 (60.0) | 11 ( 57.9) | ||
| noinfo | 4 (20.0) | 4 ( 21.1) | ||
| M_lameness (%) | NaN | |||
| _PEN | 0 ( 0.0) | 0 ( 0.0) | ||
| 0 | 9 (45.0) | 3 ( 15.8) | ||
| 3 | 0 ( 0.0) | 2 ( 10.5) | ||
| NSAIDS | 1 ( 5.0) | 1 ( 5.3) | ||
| NSAIDS_AMOX | 1 ( 5.0) | 0 ( 0.0) | ||
| NSAIDS_PEN | 7 (35.0) | 7 ( 36.8) | ||
| NSAIDS_PEN_AMOX | 0 ( 0.0) | 2 ( 10.5) | ||
| NSAIDS_PEN_SEL | 1 ( 5.0) | 0 ( 0.0) | ||
| NSAIDS_PEN_TRIM | 0 ( 0.0) | 1 ( 5.3) | ||
| NSAIDS_TETR | 0 ( 0.0) | 1 ( 5.3) | ||
| NSAIDS3 | 1 ( 5.0) | 2 ( 10.5) | ||
| M_AB_effectave (%) | 0.522 | |||
| 0 ( 0.0) | 1 ( 5.3) | |||
| 1,33 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1,5 | 1 ( 5.0) | 0 ( 0.0) | ||
| 1,67 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2 | 5 (25.0) | 3 ( 15.8) | ||
| 2,25 | 1 ( 5.0) | 1 ( 5.3) | ||
| 2,33 | 2 (10.0) | 1 ( 5.3) | ||
| 2,5 | 2 (10.0) | 1 ( 5.3) | ||
| 2,67 | 2 (10.0) | 2 ( 10.5) | ||
| 2,75 | 1 ( 5.0) | 0 ( 0.0) | ||
| 2,86 | 1 ( 5.0) | 0 ( 0.0) | ||
| 3 | 2 (10.0) | 8 ( 42.1) | ||
| 4 | 2 (10.0) | 1 ( 5.3) | ||
| OUT_SOWmortpro (mean (sd)) | 6.15 (3.57) | 11.53 (5.36) | 0.001 | |
| OUT_SOWmortdic = 1 (%) | 4 (20.0) | 14 ( 73.7) | 0.002 | |
| OUT_SOWcullpro (mean (sd)) | 6.40 (3.12) | 19.95 (4.55) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 0 ( 0.0) | 19 (100.0) | <0.001 | |
| OUT_JOKUHYLK_01 = 2 (%) | 8 (40.0) | 10 ( 58.8) | 0.417 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table3 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_JOKUHYLK_01')
table3%>%
kable("html", align = "rrr", caption = "Data variable summary strat by JOKUHYLK") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 1 | 2 | p | test | |
|---|---|---|---|---|
| n | 19 | 18 | ||
| M_parasperyear (%) | 0.505 | |||
| 0 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2 | 1 ( 5.3) | 1 ( 5.6) | ||
| 2,1 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2,2 | 0 ( 0.0) | 1 ( 5.6) | ||
| 2,3 | 7 (36.8) | 6 ( 33.3) | ||
| 2,4 | 7 (36.8) | 9 ( 50.0) | ||
| 4 | 2 (10.5) | 0 ( 0.0) | ||
| M_parasot_1before_2inFAR_3noinfo (%) | 0.860 | |||
| 1 | 9 (47.4) | 10 ( 55.6) | ||
| 2 | 7 (36.8) | 6 ( 33.3) | ||
| 3 | 3 (15.8) | 2 ( 11.1) | ||
| M_induction_0never_1sometimes (%) | 0.565 | |||
| 0 | 6 (31.6) | 6 ( 33.3) | ||
| 1 | 13 (68.4) | 11 ( 61.1) | ||
| 2 | 0 ( 0.0) | 1 ( 5.6) | ||
| M_milkfever = 1 (%) | 9 (47.4) | 9 ( 50.0) | 1.000 | |
| M_metritis = 1 (%) | 6 (31.6) | 10 ( 55.6) | 0.255 | |
| M_secr = 1 (%) | 1 ( 5.3) | 4 ( 22.2) | 0.304 | |
| M_mastitis = 1 (%) | 5 (26.3) | 4 ( 22.2) | 1.000 | |
| M_lame = 1 (%) | 15 (78.9) | 13 ( 72.2) | 0.926 | |
| M_anorex = 1 (%) | 8 (42.1) | 10 ( 55.6) | 0.625 | |
| M_fever = 1 (%) | 1 ( 5.3) | 4 ( 22.2) | 0.304 | |
| M_injury = 1 (%) | 7 (36.8) | 6 ( 33.3) | 1.000 | |
| M_pregNSAIDS100 (%) | 0.547 | |||
| 1 ( 5.3) | 1 ( 5.6) | |||
| 0 | 5 (26.3) | 5 ( 27.8) | ||
| 0,1 | 0 ( 0.0) | 1 ( 5.6) | ||
| 0,2 | 0 ( 0.0) | 1 ( 5.6) | ||
| 0,25 | 2 (10.5) | 2 ( 11.1) | ||
| 0,5 | 5 (26.3) | 1 ( 5.6) | ||
| 0,6 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 3 (15.8) | 4 ( 22.2) | ||
| 1,5 | 0 ( 0.0) | 1 ( 5.6) | ||
| 2 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2,5 | 1 ( 5.3) | 0 ( 0.0) | ||
| 3 | 1 ( 5.3) | 0 ( 0.0) | ||
| 3,5 | 0 ( 0.0) | 1 ( 5.6) | ||
| M_pregAB100 (%) | 0.676 | |||
| 1 ( 5.3) | 1 ( 5.6) | |||
| 0 | 5 (26.3) | 4 ( 22.2) | ||
| 0,2 | 0 ( 0.0) | 2 ( 11.1) | ||
| 0,25 | 1 ( 5.3) | 1 ( 5.6) | ||
| 0,5 | 5 (26.3) | 2 ( 11.1) | ||
| 0,75 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 4 (21.1) | 3 ( 16.7) | ||
| 1,5 | 2 (10.5) | 2 ( 11.1) | ||
| 10 | 0 ( 0.0) | 1 ( 5.6) | ||
| 2 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2,5 | 0 ( 0.0) | 1 ( 5.6) | ||
| M_farNSAIDS100 (%) | NaN | |||
| 1 ( 5.3) | 1 ( 5.6) | |||
| 0 | 2 (10.5) | 0 ( 0.0) | ||
| 0,5 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 1 ( 5.3) | 2 ( 11.1) | ||
| 10 | 1 ( 5.3) | 2 ( 11.1) | ||
| 100 | 2 (10.5) | 2 ( 11.1) | ||
| 15 | 1 ( 5.3) | 0 ( 0.0) | ||
| 18 | 2 (10.5) | 0 ( 0.0) | ||
| 2 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2,5 | 0 ( 0.0) | 0 ( 0.0) | ||
| 20 | 1 ( 5.3) | 0 ( 0.0) | ||
| 25 | 1 ( 5.3) | 0 ( 0.0) | ||
| 28 | 1 ( 5.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.6) | ||
| 30 | 0 ( 0.0) | 1 ( 5.6) | ||
| 35 | 0 ( 0.0) | 1 ( 5.6) | ||
| 40 | 0 ( 0.0) | 2 ( 11.1) | ||
| 5 | 1 ( 5.3) | 1 ( 5.6) | ||
| 50 | 0 ( 0.0) | 2 ( 11.1) | ||
| 6 | 2 (10.5) | 1 ( 5.6) | ||
| 7 | 1 ( 5.3) | 0 ( 0.0) | ||
| 8 | 0 ( 0.0) | 1 ( 5.6) | ||
| 90 | 1 ( 5.3) | 0 ( 0.0) | ||
| M_farAB100 (%) | NaN | |||
| 1 ( 5.3) | 2 ( 11.1) | |||
| 0 | 2 (10.5) | 0 ( 0.0) | ||
| 0,25 | 0 ( 0.0) | 0 ( 0.0) | ||
| 0,5 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 3 (15.8) | 1 ( 5.6) | ||
| 10 | 2 (10.5) | 1 ( 5.6) | ||
| 100 | 1 ( 5.3) | 0 ( 0.0) | ||
| 12 | 1 ( 5.3) | 1 ( 5.6) | ||
| 15 | 0 ( 0.0) | 1 ( 5.6) | ||
| 18 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2 | 1 ( 5.3) | 1 ( 5.6) | ||
| 2,5 | 0 ( 0.0) | 0 ( 0.0) | ||
| 20 | 0 ( 0.0) | 1 ( 5.6) | ||
| 25 | 0 ( 0.0) | 1 ( 5.6) | ||
| 3 | 0 ( 0.0) | 1 ( 5.6) | ||
| 3,5 | 1 ( 5.3) | 1 ( 5.6) | ||
| 30 | 0 ( 0.0) | 1 ( 5.6) | ||
| 4,5 | 0 ( 0.0) | 2 ( 11.1) | ||
| 5 | 1 ( 5.3) | 1 ( 5.6) | ||
| 6 | 1 ( 5.3) | 0 ( 0.0) | ||
| 7 | 1 ( 5.3) | 0 ( 0.0) | ||
| 7,5 | 2 (10.5) | 1 ( 5.6) | ||
| 8 | 1 ( 5.3) | 1 ( 5.6) | ||
| M_routine_0no_1yes = 1 (%) | 12 (63.2) | 13 ( 72.2) | 0.812 | |
| M_routine_medic (%) | 0.071 | |||
| _COC | 1 ( 5.3) | 0 ( 0.0) | ||
| _FARNSAIDS | 4 (21.1) | 0 ( 0.0) | ||
| _FARNSAIDS_COC | 0 ( 0.0) | 1 ( 5.6) | ||
| _FARNSAIDS_PPAB | 1 ( 5.3) | 0 ( 0.0) | ||
| _PPAB | 0 ( 0.0) | 2 ( 11.1) | ||
| no | 8 (42.1) | 5 ( 27.8) | ||
| OX | 5 (26.3) | 3 ( 16.7) | ||
| OX_FARNSAIDS | 0 ( 0.0) | 1 ( 5.6) | ||
| OX_FARNSAIDS_COC_PPAB | 0 ( 0.0) | 1 ( 5.6) | ||
| OX_IND | 0 ( 0.0) | 4 ( 22.2) | ||
| OX_PPAB | 0 ( 0.0) | 1 ( 5.6) | ||
| M_rAB = 1 (%) | 2 (10.5) | 4 ( 22.2) | 0.604 | |
| M_rOX = 1 (%) | 5 (26.3) | 10 ( 55.6) | 0.140 | |
| M_rIND = 1 (%) | 0 ( 0.0) | 4 ( 22.2) | 0.100 | |
| M_rFARNSAIDS = 1 (%) | 5 (26.3) | 3 ( 16.7) | 0.754 | |
| M_Farind_0no_1rout_2sometimes (%) | 0.125 | |||
| 0 | 10 (52.6) | 4 ( 22.2) | ||
| 1 | 0 ( 0.0) | 2 ( 11.1) | ||
| 2 | 9 (47.4) | 11 ( 61.1) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.6) | ||
| M_OX_10far (%) | NaN | |||
| 0 | 1 ( 5.3) | 0 ( 0.0) | ||
| 1 | 3 (15.8) | 0 ( 0.0) | ||
| 10 | 2 (10.5) | 7 ( 38.9) | ||
| 2 | 2 (10.5) | 3 ( 16.7) | ||
| 3 | 4 (21.1) | 2 ( 11.1) | ||
| 4 | 1 ( 5.3) | 0 ( 0.0) | ||
| 5 | 3 (15.8) | 0 ( 0.0) | ||
| 6 | 1 ( 5.3) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 2 ( 11.1) | ||
| 8 | 0 ( 0.0) | 0 ( 0.0) | ||
| 9 | 2 (10.5) | 2 ( 11.1) | ||
| noinfo | 0 ( 0.0) | 2 ( 11.1) | ||
| M_obstex_preOX (%) | 0.130 | |||
| 0 | 10 (52.6) | 12 ( 66.7) | ||
| 1 | 9 (47.4) | 4 ( 22.2) | ||
| noinfo | 0 ( 0.0) | 2 ( 11.1) | ||
| M_Oxdosage (%) | 0.569 | |||
| 0,3 | 1 ( 5.3) | 0 ( 0.0) | ||
| 0,4 | 1 ( 5.3) | 0 ( 0.0) | ||
| 0,5 | 3 (15.8) | 2 ( 11.1) | ||
| 0,8 | 4 (21.1) | 3 ( 16.7) | ||
| 1 | 6 (31.6) | 10 ( 55.6) | ||
| 1,3 | 1 ( 5.3) | 0 ( 0.0) | ||
| 1,5 | 1 ( 5.3) | 0 ( 0.0) | ||
| 1,8 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.6) | ||
| noinfo | 1 ( 5.3) | 2 ( 11.1) | ||
| M_OX_between (%) | 0.623 | |||
| 0,5 | 5 (26.3) | 6 ( 33.3) | ||
| 0,75 | 3 (15.8) | 1 ( 5.6) | ||
| 0,8 | 1 ( 5.3) | 0 ( 0.0) | ||
| 1 | 4 (21.1) | 7 ( 38.9) | ||
| 1,25 | 2 (10.5) | 1 ( 5.6) | ||
| 1,75 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.6) | ||
| 2,5 | 1 ( 5.3) | 0 ( 0.0) | ||
| noinfo | 2 (10.5) | 2 ( 11.1) | ||
| M_Oxmax (%) | 0.359 | |||
| 2 | 1 ( 5.3) | 3 ( 16.7) | ||
| 2,5 | 3 (15.8) | 2 ( 11.1) | ||
| 3 | 3 (15.8) | 6 ( 33.3) | ||
| 3,5 | 3 (15.8) | 2 ( 11.1) | ||
| 4 | 4 (21.1) | 0 ( 0.0) | ||
| 5 | 1 ( 5.3) | 2 ( 11.1) | ||
| 8 | 1 ( 5.3) | 0 ( 0.0) | ||
| noinfo | 3 (15.8) | 3 ( 16.7) | ||
| M_far_assist_CAT (%) | NaN | |||
| <6 | 6 (31.6) | 2 ( 11.1) | ||
| 10 | 0 ( 0.0) | 0 ( 0.0) | ||
| 15 | 0 ( 0.0) | 1 ( 5.6) | ||
| 20-50 | 5 (26.3) | 3 ( 16.7) | ||
| 50 | 2 (10.5) | 2 ( 11.1) | ||
| 6-20 | 5 (26.3) | 6 ( 33.3) | ||
| noinfo | 1 ( 5.3) | 4 ( 22.2) | ||
| M_far_assist (%) | 0.217 | |||
| 1 | 2 (10.5) | 1 ( 5.6) | ||
| 10 | 3 (15.8) | 3 ( 16.7) | ||
| 15 | 2 (10.5) | 4 ( 22.2) | ||
| 20 | 5 (26.3) | 0 ( 0.0) | ||
| 25 | 0 ( 0.0) | 2 ( 11.1) | ||
| 3 | 1 ( 5.3) | 0 ( 0.0) | ||
| 35 | 0 ( 0.0) | 1 ( 5.6) | ||
| 5 | 2 (10.5) | 1 ( 5.6) | ||
| 50 | 2 (10.5) | 2 ( 11.1) | ||
| 7 | 1 ( 5.3) | 0 ( 0.0) | ||
| noinfo | 1 ( 5.3) | 4 ( 22.2) | ||
| M_farNSAIDS_0no_1rout_2ifneed (%) | 0.671 | |||
| 1 | 4 (21.1) | 3 ( 16.7) | ||
| 2 | 12 (63.2) | 10 ( 55.6) | ||
| noinfo | 3 (15.8) | 5 ( 27.8) | ||
| M_lameness (%) | NaN | |||
| _PEN | 0 ( 0.0) | 0 ( 0.0) | ||
| 0 | 6 (31.6) | 5 ( 27.8) | ||
| 3 | 0 ( 0.0) | 2 ( 11.1) | ||
| NSAIDS | 2 (10.5) | 0 ( 0.0) | ||
| NSAIDS_AMOX | 0 ( 0.0) | 1 ( 5.6) | ||
| NSAIDS_PEN | 8 (42.1) | 5 ( 27.8) | ||
| NSAIDS_PEN_AMOX | 1 ( 5.3) | 1 ( 5.6) | ||
| NSAIDS_PEN_SEL | 0 ( 0.0) | 1 ( 5.6) | ||
| NSAIDS_PEN_TRIM | 1 ( 5.3) | 0 ( 0.0) | ||
| NSAIDS_TETR | 0 ( 0.0) | 1 ( 5.6) | ||
| NSAIDS3 | 1 ( 5.3) | 2 ( 11.1) | ||
| M_AB_effectave (%) | 0.683 | |||
| 0 ( 0.0) | 1 ( 5.6) | |||
| 1,33 | 1 ( 5.3) | 0 ( 0.0) | ||
| 1,5 | 1 ( 5.3) | 0 ( 0.0) | ||
| 1,67 | 0 ( 0.0) | 1 ( 5.6) | ||
| 2 | 4 (21.1) | 3 ( 16.7) | ||
| 2,25 | 0 ( 0.0) | 2 ( 11.1) | ||
| 2,33 | 1 ( 5.3) | 2 ( 11.1) | ||
| 2,5 | 2 (10.5) | 1 ( 5.6) | ||
| 2,67 | 2 (10.5) | 2 ( 11.1) | ||
| 2,75 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2,86 | 0 ( 0.0) | 1 ( 5.6) | ||
| 3 | 5 (26.3) | 4 ( 22.2) | ||
| 4 | 2 (10.5) | 1 ( 5.6) | ||
| OUT_SOWmortpro (mean (sd)) | 7.47 (4.19) | 11.00 (5.32) | 0.031 | |
| OUT_SOWmortdic = 1 (%) | 6 (31.6) | 12 ( 66.7) | 0.071 | |
| OUT_SOWcullpro (mean (sd)) | 10.26 (7.40) | 14.72 (7.40) | 0.076 | |
| OUT_SOWculldic = 1 (%) | 7 (36.8) | 10 ( 55.6) | 0.417 | |
| OUT_JOKUHYLK_01 = 2 (%) | 0 ( 0.0) | 18 (100.0) | <0.001 |
res_mca = MCA(med, quanti.sup = c(33,35),quali.sup=34, graph = FALSE)
summary(res_mca)
##
## Call:
## MCA(X = med, quanti.sup = c(33, 35), quali.sup = 34, graph = FALSE)
##
##
## Eigenvalues
## Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 Dim.6
## Variance 0.309 0.284 0.244 0.228 0.210 0.202
## % of var. 5.676 5.216 4.476 4.187 3.869 3.708
## Cumulative % of var. 5.676 10.892 15.368 19.556 23.424 27.133
## Dim.7 Dim.8 Dim.9 Dim.10 Dim.11 Dim.12
## Variance 0.200 0.183 0.182 0.178 0.171 0.168
## % of var. 3.675 3.367 3.343 3.281 3.138 3.088
## Cumulative % of var. 30.808 34.174 37.517 40.797 43.936 47.024
## Dim.13 Dim.14 Dim.15 Dim.16 Dim.17 Dim.18
## Variance 0.154 0.154 0.149 0.143 0.141 0.136
## % of var. 2.839 2.829 2.746 2.628 2.593 2.497
## Cumulative % of var. 49.863 52.692 55.438 58.067 60.660 63.157
## Dim.19 Dim.20 Dim.21 Dim.22 Dim.23 Dim.24
## Variance 0.132 0.125 0.118 0.116 0.112 0.108
## % of var. 2.427 2.299 2.165 2.133 2.062 1.980
## Cumulative % of var. 65.584 67.882 70.048 72.181 74.243 76.222
## Dim.25 Dim.26 Dim.27 Dim.28 Dim.29 Dim.30
## Variance 0.103 0.097 0.095 0.089 0.088 0.086
## % of var. 1.899 1.786 1.742 1.645 1.616 1.576
## Cumulative % of var. 78.121 79.907 81.650 83.295 84.911 86.487
## Dim.31 Dim.32 Dim.33 Dim.34 Dim.35 Dim.36
## Variance 0.078 0.076 0.074 0.072 0.070 0.065
## % of var. 1.431 1.398 1.353 1.329 1.292 1.197
## Cumulative % of var. 87.918 89.316 90.668 91.998 93.290 94.487
## Dim.37 Dim.38 Dim.39 Dim.40 Dim.41 Dim.42
## Variance 0.060 0.056 0.050 0.048 0.044 0.043
## % of var. 1.101 1.032 0.910 0.881 0.805 0.784
## Cumulative % of var. 95.588 96.620 97.530 98.411 99.216 100.000
##
## Individuals (the 10 first)
## Dim.1 ctr cos2 Dim.2 ctr
## 1 | 0.014 0.001 0.000 | 1.153 10.892
## 2 | -0.142 0.153 0.004 | -0.250 0.511
## 3 | -0.093 0.065 0.002 | 0.007 0.000
## 4 | -0.188 0.266 0.006 | 0.363 1.081
## 5 | 1.179 10.458 0.242 | 0.190 0.295
## 6 | -0.466 1.637 0.027 | -0.045 0.016
## 7 | -0.038 0.011 0.000 | -0.210 0.362
## 8 | -0.470 1.662 0.034 | 0.005 0.000
## 9 | -0.476 1.708 0.069 | -0.506 2.096
## 10 | 0.185 0.256 0.006 | 0.606 3.007
## cos2 Dim.3 ctr cos2
## 1 0.207 | 0.157 0.235 0.004 |
## 2 0.013 | 0.618 3.649 0.077 |
## 3 0.000 | 0.329 1.031 0.027 |
## 4 0.021 | 0.158 0.239 0.004 |
## 5 0.006 | -0.824 6.489 0.119 |
## 6 0.000 | -0.583 3.242 0.043 |
## 7 0.007 | 0.341 1.113 0.019 |
## 8 0.000 | 0.485 2.244 0.037 |
## 9 0.077 | -0.272 0.704 0.022 |
## 10 0.063 | -0.699 4.663 0.084 |
##
## Categories (the 10 first)
## Dim.1 ctr cos2 v.test Dim.2
## M_parasperyear_0 | 0.041 0.001 0.000 0.058 | 0.060
## M_parasperyear_1 | -0.103 0.002 0.000 -0.103 | -1.570
## M_parasperyear_2 | -0.867 0.499 0.056 -1.538 | -0.459
## M_parasperyear_2,1 | -0.694 0.107 0.011 -0.694 | 0.025
## M_parasperyear_2,2 | -0.579 0.074 0.008 -0.579 | -1.061
## M_parasperyear_2,3 | 0.068 0.015 0.002 0.320 | -0.416
## M_parasperyear_2,4 | 0.262 0.273 0.049 1.440 | 0.537
## M_parasperyear_4 | -0.915 0.371 0.041 -1.310 | 0.214
## M_parasot_1before_2inFAR_3noinfo_1 | 0.273 0.314 0.059 1.576 | 0.174
## M_parasot_1before_2inFAR_3noinfo_2 | -0.023 0.002 0.000 -0.115 | 0.019
## ctr cos2 v.test Dim.3 ctr
## M_parasperyear_0 0.002 0.000 0.086 | -2.057 2.377
## M_parasperyear_1 0.594 0.059 -1.570 | -0.339 0.032
## M_parasperyear_2 0.153 0.016 -0.815 | -0.898 0.679
## M_parasperyear_2,1 0.000 0.000 0.025 | 0.842 0.199
## M_parasperyear_2,2 0.271 0.027 -1.061 | -0.466 0.061
## M_parasperyear_2,3 0.624 0.093 -1.971 | -0.043 0.008
## M_parasperyear_2,4 1.252 0.208 2.954 | 0.384 0.745
## M_parasperyear_4 0.022 0.002 0.306 | 0.255 0.036
## M_parasot_1before_2inFAR_3noinfo_1 0.138 0.024 1.002 | -0.228 0.278
## M_parasot_1before_2inFAR_3noinfo_2 0.001 0.000 0.095 | 0.360 0.583
## cos2 v.test
## M_parasperyear_0 0.206 -2.945 |
## M_parasperyear_1 0.003 -0.339 |
## M_parasperyear_2 0.060 -1.593 |
## M_parasperyear_2,1 0.017 0.842 |
## M_parasperyear_2,2 0.005 -0.466 |
## M_parasperyear_2,3 0.001 -0.205 |
## M_parasperyear_2,4 0.106 2.111 |
## M_parasperyear_4 0.003 0.364 |
## M_parasot_1before_2inFAR_3noinfo_1 0.041 -1.317 |
## M_parasot_1before_2inFAR_3noinfo_2 0.077 1.797 |
##
## Categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## M_parasperyear | 0.141 0.282 0.343 |
## M_parasot_1before_2inFAR_3noinfo | 0.101 0.051 0.077 |
## M_induction_0never_1sometimes | 0.054 0.224 0.107 |
## M_milkfever | 0.005 0.000 0.034 |
## M_metritis | 0.010 0.069 0.034 |
## M_secr | 0.143 0.149 0.062 |
## M_mastitis | 0.019 0.036 0.002 |
## M_lame | 0.002 0.091 0.228 |
## M_anorex | 0.006 0.101 0.143 |
## M_fever | 0.015 0.088 0.103 |
##
## Supplementary categories
## Dim.1 cos2 v.test Dim.2 cos2
## OUT_SOWmortdic_0 | -0.226 0.059 -1.570 | -0.045 0.002
## OUT_SOWmortdic_1 | 0.260 0.059 1.570 | 0.052 0.002
## v.test Dim.3 cos2 v.test
## OUT_SOWmortdic_0 -0.312 | 0.074 0.006 0.517 |
## OUT_SOWmortdic_1 0.312 | -0.086 0.006 -0.517 |
##
## Supplementary categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## OUT_SOWmortdic | 0.059 0.002 0.006 |
##
## Supplementary continuous variables
## Dim.1 Dim.2 Dim.3
## OUT_SOWmortpro | 0.284 | 0.140 | -0.052 |
## OUT_SOWcullpro | 0.232 | -0.108 | -0.151 |
To visualize the percentage of inertia explained by each MCA dimension:
eig.val <- res_mca$eig
barplot(eig.val[, 2],
names.arg = 1:nrow(eig.val),
main = "Variances Explained by Dimensions (%)",
xlab = "Principal Dimensions",
ylab = "Percentage of variances",
col ="steelblue")
# Add connected line segments to the plot
lines(x = 1:nrow(eig.val), eig.val[, 2],
type = "b", pch = 19, col = "red")
res <- explor::prepare_results(res_mca)
explor::MCA_var_plot(res, xax = 1, yax = 2,
var_sup = TRUE, var_lab_min_contrib = 0,
col_var = "Variable", symbol_var = "Type",
size_var = NULL, size_range = c(10, 300),
labels_size = 10, point_size = 56,
transitions = TRUE, labels_positions = NULL)
res <- explor::prepare_results(res_mca)
explor::MCA_ind_plot(res, xax = 1, yax = 2,ind_sup = FALSE,
lab_var = NULL, , ind_lab_min_contrib = 0,
col_var = NULL, labels_size = 9,
point_opacity = 0.5, opacity_var = NULL, point_size = 64,
ellipses = FALSE, transitions = TRUE, labels_positions = NULL)
fviz_mca_var(res_mca, choice = "quanti.sup",
ggtheme = theme_minimal())
## ```{r, echo = FALSE}
## res.hcpc = HCPC(res, nb.clust = -1, graph = FALSE)
## ```
##
## ```
## drawn <-
## c("13", "24", "21", "5", "1", "39", "40", "9", "16", "43")
## par(mar = c(4.1, 4.1, 1.1, 2.1))
## plot.HCPC(res.hcpc, choice = 'map', draw.tree = FALSE, select = drawn, title = '')
## ```
##
## **Figure - Ascending Hierarchical Classification of the individuals.**
## *The classification made on individuals reveals 6 clusters.*
##
##
## The cluster 1 is made of individuals sharing :
##
## - high frequency for factors like *M_farNSAIDS100=M_farNSAIDS100_0,5*, *M_parasperyear=M_parasperyear_2*, *M_Oxmax=M_Oxmax_2*, *M_parasot_1before_2inFAR_3noinfo=M_parasot_1before_2inFAR_3noinfo_3*, *M_far_assist=M_far_assist_10*, *M_AB_effectave=M_AB_effectave_1,67*, *M_lameness=M_lameness_NSAIDS_AMOX*, *M_far_assist_CAT=M_far_assist_CAT_10*, *M_OX_10far=M_OX_10far_8* and *M_farAB100=M_farAB100_0,25* (factors are sorted from the most common).
##
## The cluster 2 is made of individuals such as*. This group is characterized by9* and *9*. :
##
## - high frequency for factors like *M_routine_0no_1yes=M_routine_0no_1yes_0*, *M_routine_medic=no*, *M_farNSAIDS_0no_1rout_2ifneed=M_farNSAIDS_0no_1rout_2ifneed_2*, *M_Farind_0no_1rout_2sometimes=M_Farind_0no_1rout_2sometimes_0*, *M_pregNSAIDS100=M_pregNSAIDS100_0*, *M_far_assist_CAT=M_far_assist_CAT_<6*, *M_rFARNSAIDS=M_rFARNSAIDS_0*, *M_pregAB100=M_pregAB100_0*, *M_far_assist=M_far_assist_1* and *M_farNSAIDS100=M_farNSAIDS100_0* (factors are sorted from the most common).
## - low frequency for the factors *M_routine_0no_1yes=M_routine_0no_1yes_1*, *M_Farind_0no_1rout_2sometimes=M_Farind_0no_1rout_2sometimes_2*, *M_rFARNSAIDS=M_rFARNSAIDS_1*, *M_OX_10far=M_OX_10far_10*, *M_farNSAIDS_0no_1rout_2ifneed=M_farNSAIDS_0no_1rout_2ifneed_noinfo*, *M_far_assist_CAT=M_far_assist_CAT_20-50*, *M_farNSAIDS_0no_1rout_2ifneed=M_farNSAIDS_0no_1rout_2ifneed_1*, *M_pregAB100=M_pregAB100_1* and *M_parasperyear=M_parasperyear_2,4* (factors are sorted from the rarest).
##
## The cluster 3 is made of individuals sharing :
##
## - high frequency for the factors *M_routine_0no_1yes=M_routine_0no_1yes_1*, *M_far_assist_CAT=M_far_assist_CAT_20-50*, *M_far_assist=M_far_assist_20*, *M_routine_medic=_FARNSAIDS*, *M_Oxmax=M_Oxmax_4*, *M_lameness=M_lameness_0*, *M_AB_effectave=M_AB_effectave_2,5*, *M_Oxmax=M_Oxmax_3,5*, *M_injury=M_injury_0* and *M_lame=M_lame_0* (factors are sorted from the most common).
## - low frequency for the factors *M_routine_0no_1yes=M_routine_0no_1yes_0*, *M_routine_medic=no*, *M_injury=M_injury_1*, *M_lame=M_lame_1* and *M_induction_0never_1sometimes=M_induction_0never_1sometimes_1* (factors are sorted from the rarest).
##
## The cluster 4 is made of individuals such as*. This group is characterized by1* and *1*. :
##
## - high frequency for factors like *M_fever=M_fever_1*, *M_farAB100=M_farAB100_3,5*, *M_farNSAIDS_0no_1rout_2ifneed=M_farNSAIDS_0no_1rout_2ifneed_1*, *M_OX_10far=M_OX_10far_10*, *M_rFARNSAIDS=M_rFARNSAIDS_1*, *M_pregAB100=M_pregAB100_1,5*, *M_farNSAIDS100=M_farNSAIDS100_100*, *M_secr=M_secr_1*, *M_injury=M_injury_1* and *M_Oxmax=M_Oxmax_2,5* (factors are sorted from the most common).
## - low frequency for the factors *M_fever=M_fever_0*, *M_rFARNSAIDS=M_rFARNSAIDS_0*, *M_secr=M_secr_0*, *M_injury=M_injury_0* and *M_rAB=M_rAB_0* (factors are sorted from the rarest).
##
## The cluster 5 is made of individuals such as*. This group is characterized by5* and *5*. :
##
## - high frequency for factors like *M_rOX=M_rOX_1*, *M_far_assist=M_far_assist_50*, *M_far_assist_CAT=M_far_assist_CAT_50*, *M_rIND=M_rIND_1*, *M_routine_medic=OX_IND*, *M_lameness=M_lameness_3*, *M_farNSAIDS100=M_farNSAIDS100_40*, *M_pregAB100=M_pregAB100_0,25*, *M_pregAB100=M_pregAB100_0,2* and *M_induction_0never_1sometimes=M_induction_0never_1sometimes_1* (factors are sorted from the most common).
## - low frequency for the factors *M_rOX=M_rOX_0*, *M_rIND=M_rIND_0*, *M_Farind_0no_1rout_2sometimes=M_Farind_0no_1rout_2sometimes_0*, *M_induction_0never_1sometimes=M_induction_0never_1sometimes_0* and *M_routine_medic=no* (factors are sorted from the rarest).
##
## The cluster 6 is made of individuals such as*. This group is characterized by13* and *13*. :
##
## - high frequency for factors like *M_far_assist=M_far_assist_noinfo*, *M_far_assist_CAT=M_far_assist_CAT_noinfo*, *M_Oxmax=M_Oxmax_noinfo*, *M_obstex_preOX=M_obstex_preOX_noinfo*, *M_farNSAIDS100=M_farNSAIDS100_*, *M_pregAB100=M_pregAB100_*, *M_pregNSAIDS100=M_pregNSAIDS100_*, *M_farNSAIDS_0no_1rout_2ifneed=M_farNSAIDS_0no_1rout_2ifneed_noinfo*, *M_Oxdosage=M_Oxdosage_noinfo* and *M_OX_10far=M_OX_10far_noinfo* (factors are sorted from the most common).
## **Results for the Hierarchical Clustering on Principal Components**
## name
## 1 "$data.clust"
## 2 "$desc.var"
## 3 "$desc.var$test.chi2"
## 4 "$desc.axes$category"
## 5 "$desc.axes"
## 6 "$desc.axes$quanti.var"
## 7 "$desc.axes$quanti"
## 8 "$desc.ind"
## 9 "$desc.ind$para"
## 10 "$desc.ind$dist"
## 11 "$call"
## 12 "$call$t"
## description
## 1 "dataset with the cluster of the individuals"
## 2 "description of the clusters by the variables"
## 3 "description of the cluster var. by the categorical var."
## 4 "description of the clusters by the categories."
## 5 "description of the clusters by the dimensions"
## 6 "description of the cluster var. by the axes"
## 7 "description of the clusters by the axes"
## 8 "description of the clusters by the individuals"
## 9 "parangons of each clusters"
## 10 "specific individuals"
## 11 "summary statistics"
## 12 "description of the tree"
# load data
setwd("~/GitHub/tilataso")
library(readr)
library(FactoMineR)
library(FactoInvestigate)
library(factoextra)
library(dplyr)
library(explor)
med<-read.csv(file="bio.csv", header=TRUE)
med<-med%>%mutate_all(as.factor)
med$OUT_SOWcullpro<-as.numeric(med$OUT_SOWcullpro)
med$OUT_SOWmortpro<-as.numeric(med$OUT_SOWmortpro)
medcat<-med %>% select(-ends_with("pro"))
mednum<-med %>% select(ends_with("pro"))
colnames(medcat)
## [1] "B_Biosec" "B_Biosecok" "B_Biosec_012"
## [4] "B_Pests" "B_Entrancehuman" "B_Entranceanimal"
## [7] "B_Handswash" "B_Bootswash" "B_Loadingbay"
## [10] "B_Entrancedriver" "B_carcasstruckenter" "B_pestentercarcass"
## [13] "B_pestcontrol" "B_pestsigns" "B_birds"
## [16] "B_pestcontrolplan" "B_cats" "B_pets_in"
## [19] "B_biosecsum" "OUT_SOWmortdic" "OUT_SOWculldic"
## [22] "OUT_JOKUHYLK_01"
library(tidyr)
gather(medcat) %>% ggplot(aes(value)) + facet_wrap("key", scales = "free") + geom_bar(fill="pink") + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8))+ scale_fill_manual("key")
library(dplyr)
library(ggplot2)
out<-med %>% dplyr::select(ends_with("pro"))
#Matrix of plots
ggpairs(out, lower = list(combo = wrap("facethist", bins = 20)), title="Graphical overview of the 2 outcome variables")
library(tableone)
KreateTableOne = function(x, ...){
t1 = tableone::CreateTableOne(data=x, ...)
t2 = print(t1, quote=TRUE)
rownames(t2) = gsub(pattern='\\"', replacement='', rownames(t2))
colnames(t2) = gsub(pattern='\\"', replacement='', colnames(t2))
return(t2)
}
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table1 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWmortdic')
table1%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow mortality") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 23 | 20 | ||
| B_Biosec = 1 (%) | 15 (65.2) | 15 ( 75.0) | 0.716 | |
| B_Biosecok = 1 (%) | 9 (39.1) | 12 ( 60.0) | 0.289 | |
| B_Biosec_012 (%) | 0.731 | |||
| 0 | 8 (36.4) | 5 ( 26.3) | ||
| 1 | 6 (27.3) | 5 ( 26.3) | ||
| 2 | 8 (36.4) | 9 ( 47.4) | ||
| B_Pests = 1 (%) | 16 (69.6) | 19 ( 95.0) | 0.081 | |
| B_Entrancehuman = 1 (%) | 16 (69.6) | 11 ( 55.0) | 0.503 | |
| B_Entranceanimal = 1 (%) | 14 (60.9) | 16 ( 80.0) | 0.303 | |
| B_Handswash = 1 (%) | 14 (60.9) | 16 ( 80.0) | 0.303 | |
| B_Bootswash = 1 (%) | 14 (60.9) | 17 ( 85.0) | 0.156 | |
| B_Loadingbay = 1 (%) | 19 (82.6) | 17 ( 85.0) | 1.000 | |
| B_Entrancedriver = 1 (%) | 17 (73.9) | 13 ( 65.0) | 0.763 | |
| B_carcasstruckenter (%) | 0.435 | |||
| 0 | 7 (30.4) | 9 ( 45.0) | ||
| 1 | 15 (65.2) | 11 ( 55.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| B_pestentercarcass (%) | 0.705 | |||
| 2 ( 8.7) | 1 ( 5.0) | |||
| no | 11 (47.8) | 12 ( 60.0) | ||
| yes | 10 (43.5) | 7 ( 35.0) | ||
| B_pestcontrol (%) | 0.158 | |||
| catdogpois | 0 ( 0.0) | 1 ( 5.0) | ||
| catdogpoistrap | 1 ( 4.3) | 0 ( 0.0) | ||
| catdogpoistrapfirm | 1 ( 4.3) | 0 ( 0.0) | ||
| catpois | 6 (26.1) | 4 ( 20.0) | ||
| catpoisother | 0 ( 0.0) | 1 ( 5.0) | ||
| catpoistrap | 5 (21.7) | 0 ( 0.0) | ||
| catpoistrapother | 1 ( 4.3) | 0 ( 0.0) | ||
| nothing | 0 ( 0.0) | 1 ( 5.0) | ||
| pois | 7 (30.4) | 6 ( 30.0) | ||
| poistrap | 2 ( 8.7) | 6 ( 30.0) | ||
| trap | 0 ( 0.0) | 1 ( 5.0) | ||
| B_pestsigns (%) | 0.271 | |||
| no | 5 (21.7) | 5 ( 25.0) | ||
| noinfo | 0 ( 0.0) | 2 ( 10.0) | ||
| yes | 18 (78.3) | 13 ( 65.0) | ||
| B_birds (%) | 0.603 | |||
| no | 16 (69.6) | 11 ( 55.0) | ||
| noinfo | 2 ( 8.7) | 3 ( 15.0) | ||
| yes | 5 (21.7) | 6 ( 30.0) | ||
| B_pestcontrolplan (%) | 0.431 | |||
| no | 17 (73.9) | 11 ( 55.0) | ||
| noinfo | 4 (17.4) | 6 ( 30.0) | ||
| yes | 2 ( 8.7) | 3 ( 15.0) | ||
| B_cats (%) | 0.005 | |||
| no | 4 (17.4) | 11 ( 55.0) | ||
| noinfo | 0 ( 0.0) | 2 ( 10.0) | ||
| yes | 19 (82.6) | 7 ( 35.0) | ||
| B_pets_in (%) | 0.298 | |||
| no | 15 (65.2) | 12 ( 60.0) | ||
| noinfo | 2 ( 8.7) | 5 ( 25.0) | ||
| yes | 6 (26.1) | 3 ( 15.0) | ||
| B_biosecsum (%) | 0.680 | |||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 7 | 2 ( 8.7) | 0 ( 0.0) | ||
| 8 | 1 ( 4.3) | 2 ( 10.0) | ||
| 9 | 1 ( 4.3) | 0 ( 0.0) | ||
| 10 | 4 (17.4) | 0 ( 0.0) | ||
| 11 | 1 ( 4.3) | 1 ( 5.0) | ||
| 12 | 2 ( 8.7) | 2 ( 10.0) | ||
| 13 | 1 ( 4.3) | 2 ( 10.0) | ||
| 14 | 2 ( 8.7) | 4 ( 20.0) | ||
| 15 | 3 (13.0) | 3 ( 15.0) | ||
| 16 | 3 (13.0) | 3 ( 15.0) | ||
| 17 | 1 ( 4.3) | 1 ( 5.0) | ||
| 18 | 1 ( 4.3) | 1 ( 5.0) | ||
| 19 | 1 ( 4.3) | 0 ( 0.0) | ||
| OUT_SOWmortpro (mean (sd)) | 4.74 (2.12) | 13.35 (3.27) | <0.001 | |
| OUT_SOWmortdic = 1 (%) | 0 ( 0.0) | 20 (100.0) | <0.001 | |
| OUT_SOWcullpro (mean (sd)) | 8.81 (6.62) | 17.89 (6.29) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 5 (23.8) | 14 ( 77.8) | 0.002 | |
| OUT_JOKUHYLK_01 = 2 (%) | 6 (31.6) | 12 ( 66.7) | 0.071 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table2 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWculldic')
table2%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow cull") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 20 | 19 | ||
| B_Biosec = 1 (%) | 12 (60.0) | 15 ( 78.9) | 0.350 | |
| B_Biosecok = 1 (%) | 6 (30.0) | 12 ( 63.2) | 0.079 | |
| B_Biosec_012 (%) | 0.281 | |||
| 0 | 8 (42.1) | 4 ( 22.2) | ||
| 1 | 6 (31.6) | 5 ( 27.8) | ||
| 2 | 5 (26.3) | 9 ( 50.0) | ||
| B_Pests = 1 (%) | 16 (80.0) | 15 ( 78.9) | 1.000 | |
| B_Entrancehuman = 1 (%) | 13 (65.0) | 11 ( 57.9) | 0.899 | |
| B_Entranceanimal = 1 (%) | 14 (70.0) | 13 ( 68.4) | 1.000 | |
| B_Handswash = 1 (%) | 14 (70.0) | 14 ( 73.7) | 1.000 | |
| B_Bootswash = 1 (%) | 15 (75.0) | 13 ( 68.4) | 0.920 | |
| B_Loadingbay = 1 (%) | 16 (80.0) | 17 ( 89.5) | 0.707 | |
| B_Entrancedriver = 1 (%) | 15 (75.0) | 12 ( 63.2) | 0.650 | |
| B_carcasstruckenter (%) | 0.374 | |||
| 0 | 6 (30.0) | 9 ( 47.4) | ||
| 1 | 13 (65.0) | 10 ( 52.6) | ||
| 2 | 1 ( 5.0) | 0 ( 0.0) | ||
| B_pestentercarcass (%) | 0.857 | |||
| 2 (10.0) | 1 ( 5.3) | |||
| no | 10 (50.0) | 10 ( 52.6) | ||
| yes | 8 (40.0) | 8 ( 42.1) | ||
| B_pestcontrol (%) | 0.614 | |||
| catdogpois | 0 ( 0.0) | 1 ( 5.3) | ||
| catdogpoistrap | 1 ( 5.0) | 0 ( 0.0) | ||
| catdogpoistrapfirm | 1 ( 5.0) | 0 ( 0.0) | ||
| catpois | 5 (25.0) | 3 ( 15.8) | ||
| catpoisother | 0 ( 0.0) | 1 ( 5.3) | ||
| catpoistrap | 3 (15.0) | 2 ( 10.5) | ||
| catpoistrapother | 1 ( 5.0) | 0 ( 0.0) | ||
| nothing | 1 ( 5.0) | 0 ( 0.0) | ||
| pois | 5 (25.0) | 7 ( 36.8) | ||
| poistrap | 3 (15.0) | 4 ( 21.1) | ||
| trap | 0 ( 0.0) | 1 ( 5.3) | ||
| B_pestsigns (%) | 0.299 | |||
| no | 6 (30.0) | 4 ( 21.1) | ||
| noinfo | 0 ( 0.0) | 2 ( 10.5) | ||
| yes | 14 (70.0) | 13 ( 68.4) | ||
| B_birds (%) | 0.843 | |||
| no | 13 (65.0) | 11 ( 57.9) | ||
| noinfo | 2 (10.0) | 3 ( 15.8) | ||
| yes | 5 (25.0) | 5 ( 26.3) | ||
| B_pestcontrolplan (%) | 0.722 | |||
| no | 15 (75.0) | 12 ( 63.2) | ||
| noinfo | 3 (15.0) | 4 ( 21.1) | ||
| yes | 2 (10.0) | 3 ( 15.8) | ||
| B_cats (%) | 0.122 | |||
| no | 6 (30.0) | 9 ( 47.4) | ||
| noinfo | 0 ( 0.0) | 2 ( 10.5) | ||
| yes | 14 (70.0) | 8 ( 42.1) | ||
| B_pets_in (%) | 0.724 | |||
| no | 14 (70.0) | 11 ( 57.9) | ||
| noinfo | 2 (10.0) | 3 ( 15.8) | ||
| yes | 4 (20.0) | 5 ( 26.3) | ||
| B_biosecsum (%) | 0.845 | |||
| 2 | 0 ( 0.0) | 1 ( 5.3) | ||
| 7 | 1 ( 5.0) | 1 ( 5.3) | ||
| 8 | 2 (10.0) | 1 ( 5.3) | ||
| 9 | 1 ( 5.0) | 0 ( 0.0) | ||
| 10 | 2 (10.0) | 2 ( 10.5) | ||
| 11 | 1 ( 5.0) | 0 ( 0.0) | ||
| 12 | 1 ( 5.0) | 3 ( 15.8) | ||
| 13 | 1 ( 5.0) | 2 ( 10.5) | ||
| 14 | 3 (15.0) | 3 ( 15.8) | ||
| 15 | 3 (15.0) | 3 ( 15.8) | ||
| 16 | 1 ( 5.0) | 2 ( 10.5) | ||
| 17 | 2 (10.0) | 0 ( 0.0) | ||
| 18 | 1 ( 5.0) | 1 ( 5.3) | ||
| 19 | 1 ( 5.0) | 0 ( 0.0) | ||
| OUT_SOWmortpro (mean (sd)) | 6.15 (3.57) | 11.53 (5.36) | 0.001 | |
| OUT_SOWmortdic = 1 (%) | 4 (20.0) | 14 ( 73.7) | 0.002 | |
| OUT_SOWcullpro (mean (sd)) | 6.40 (3.12) | 19.95 (4.55) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 0 ( 0.0) | 19 (100.0) | <0.001 | |
| OUT_JOKUHYLK_01 = 2 (%) | 8 (40.0) | 10 ( 58.8) | 0.417 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table3 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_JOKUHYLK_01')
table3%>%
kable("html", align = "rrr", caption = "Data variable summary strat by JOKUHYLK") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 1 | 2 | p | test | |
|---|---|---|---|---|
| n | 19 | 18 | ||
| B_Biosec = 1 (%) | 13 (68.4) | 13 ( 72.2) | 1.000 | |
| B_Biosecok = 1 (%) | 8 (42.1) | 9 ( 50.0) | 0.879 | |
| B_Biosec_012 (%) | 0.891 | |||
| 0 | 6 (35.3) | 5 ( 27.8) | ||
| 1 | 5 (29.4) | 6 ( 33.3) | ||
| 2 | 6 (35.3) | 7 ( 38.9) | ||
| B_Pests = 1 (%) | 15 (78.9) | 16 ( 88.9) | 0.709 | |
| B_Entrancehuman = 1 (%) | 14 (73.7) | 9 ( 50.0) | 0.252 | |
| B_Entranceanimal = 1 (%) | 12 (63.2) | 14 ( 77.8) | 0.540 | |
| B_Handswash = 1 (%) | 12 (63.2) | 15 ( 83.3) | 0.312 | |
| B_Bootswash = 1 (%) | 13 (68.4) | 14 ( 77.8) | 0.787 | |
| B_Loadingbay = 1 (%) | 15 (78.9) | 16 ( 88.9) | 0.709 | |
| B_Entrancedriver = 1 (%) | 14 (73.7) | 11 ( 61.1) | 0.642 | |
| B_carcasstruckenter (%) | 0.486 | |||
| 0 | 6 (31.6) | 8 ( 44.4) | ||
| 1 | 12 (63.2) | 10 ( 55.6) | ||
| 2 | 1 ( 5.3) | 0 ( 0.0) | ||
| B_pestentercarcass (%) | 0.178 | |||
| 1 ( 5.3) | 2 ( 11.1) | |||
| no | 7 (36.8) | 11 ( 61.1) | ||
| yes | 11 (57.9) | 5 ( 27.8) | ||
| B_pestcontrol (%) | 0.392 | |||
| catdogpois | 0 ( 0.0) | 1 ( 5.6) | ||
| catdogpoistrap | 1 ( 5.3) | 0 ( 0.0) | ||
| catdogpoistrapfirm | 0 ( 0.0) | 1 ( 5.6) | ||
| catpois | 5 (26.3) | 3 ( 16.7) | ||
| catpoisother | 0 ( 0.0) | 1 ( 5.6) | ||
| catpoistrap | 4 (21.1) | 1 ( 5.6) | ||
| catpoistrapother | 1 ( 5.3) | 0 ( 0.0) | ||
| nothing | 1 ( 5.3) | 0 ( 0.0) | ||
| pois | 5 (26.3) | 5 ( 27.8) | ||
| poistrap | 2 (10.5) | 5 ( 27.8) | ||
| trap | 0 ( 0.0) | 1 ( 5.6) | ||
| B_pestsigns (%) | 0.380 | |||
| no | 7 (36.8) | 3 ( 16.7) | ||
| noinfo | 1 ( 5.3) | 1 ( 5.6) | ||
| yes | 11 (57.9) | 14 ( 77.8) | ||
| B_birds (%) | 0.522 | |||
| no | 13 (68.4) | 9 ( 50.0) | ||
| noinfo | 2 (10.5) | 3 ( 16.7) | ||
| yes | 4 (21.1) | 6 ( 33.3) | ||
| B_pestcontrolplan (%) | 0.029 | |||
| no | 16 (84.2) | 9 ( 50.0) | ||
| noinfo | 3 (15.8) | 4 ( 22.2) | ||
| yes | 0 ( 0.0) | 5 ( 27.8) | ||
| B_cats (%) | 0.858 | |||
| no | 8 (42.1) | 6 ( 33.3) | ||
| noinfo | 1 ( 5.3) | 1 ( 5.6) | ||
| yes | 10 (52.6) | 11 ( 61.1) | ||
| B_pets_in (%) | 0.657 | |||
| no | 13 (68.4) | 11 ( 61.1) | ||
| noinfo | 3 (15.8) | 2 ( 11.1) | ||
| yes | 3 (15.8) | 5 ( 27.8) | ||
| B_biosecsum (%) | 0.774 | |||
| 2 | 1 ( 5.3) | 0 ( 0.0) | ||
| 7 | 2 (10.5) | 0 ( 0.0) | ||
| 8 | 2 (10.5) | 1 ( 5.6) | ||
| 9 | 0 ( 0.0) | 1 ( 5.6) | ||
| 10 | 2 (10.5) | 1 ( 5.6) | ||
| 11 | 1 ( 5.3) | 0 ( 0.0) | ||
| 12 | 1 ( 5.3) | 2 ( 11.1) | ||
| 13 | 1 ( 5.3) | 2 ( 11.1) | ||
| 14 | 4 (21.1) | 2 ( 11.1) | ||
| 15 | 2 (10.5) | 4 ( 22.2) | ||
| 16 | 1 ( 5.3) | 2 ( 11.1) | ||
| 17 | 1 ( 5.3) | 1 ( 5.6) | ||
| 18 | 1 ( 5.3) | 1 ( 5.6) | ||
| 19 | 0 ( 0.0) | 1 ( 5.6) | ||
| OUT_SOWmortpro (mean (sd)) | 7.47 (4.19) | 11.00 (5.32) | 0.031 | |
| OUT_SOWmortdic = 1 (%) | 6 (31.6) | 12 ( 66.7) | 0.071 | |
| OUT_SOWcullpro (mean (sd)) | 10.26 (7.40) | 14.72 (7.40) | 0.076 | |
| OUT_SOWculldic = 1 (%) | 7 (36.8) | 10 ( 55.6) | 0.417 | |
| OUT_JOKUHYLK_01 = 2 (%) | 0 ( 0.0) | 18 (100.0) | <0.001 |
res_mca = MCA(med, quanti.sup = c(20,22) ,quali.sup=24, graph = FALSE)
summary(res_mca)
##
## Call:
## MCA(X = med, quanti.sup = c(20, 22), quali.sup = 24, graph = FALSE)
##
##
## Eigenvalues
## Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 Dim.6
## Variance 0.220 0.191 0.166 0.140 0.135 0.129
## % of var. 8.867 7.732 6.720 5.667 5.435 5.190
## Cumulative % of var. 8.867 16.599 23.319 28.986 34.421 39.611
## Dim.7 Dim.8 Dim.9 Dim.10 Dim.11 Dim.12
## Variance 0.118 0.115 0.108 0.095 0.089 0.087
## % of var. 4.766 4.625 4.373 3.819 3.613 3.502
## Cumulative % of var. 44.377 49.002 53.374 57.194 60.807 64.309
## Dim.13 Dim.14 Dim.15 Dim.16 Dim.17 Dim.18
## Variance 0.079 0.073 0.070 0.067 0.060 0.059
## % of var. 3.191 2.967 2.818 2.723 2.442 2.376
## Cumulative % of var. 67.500 70.467 73.285 76.009 78.451 80.827
## Dim.19 Dim.20 Dim.21 Dim.22 Dim.23 Dim.24
## Variance 0.055 0.044 0.044 0.042 0.036 0.033
## % of var. 2.209 1.794 1.762 1.693 1.472 1.336
## Cumulative % of var. 83.036 84.830 86.593 88.286 89.758 91.094
## Dim.25 Dim.26 Dim.27 Dim.28 Dim.29 Dim.30
## Variance 0.031 0.028 0.026 0.021 0.020 0.017
## % of var. 1.260 1.124 1.044 0.868 0.793 0.671
## Cumulative % of var. 92.353 93.478 94.522 95.389 96.182 96.854
## Dim.31 Dim.32 Dim.33 Dim.34 Dim.35 Dim.36
## Variance 0.015 0.013 0.011 0.008 0.008 0.007
## % of var. 0.596 0.505 0.427 0.341 0.335 0.265
## Cumulative % of var. 97.449 97.955 98.382 98.723 99.057 99.322
## Dim.37 Dim.38 Dim.39 Dim.40 Dim.41 Dim.42
## Variance 0.006 0.004 0.003 0.003 0.001 0.001
## % of var. 0.225 0.165 0.125 0.109 0.030 0.024
## Cumulative % of var. 99.547 99.712 99.837 99.946 99.976 100.000
##
## Individuals (the 10 first)
## Dim.1 ctr cos2 Dim.2 ctr cos2 Dim.3
## 1 | 0.075 0.060 0.002 | -0.146 0.261 0.009 | -0.475
## 2 | -0.195 0.402 0.023 | 0.515 3.221 0.162 | -0.013
## 3 | -0.434 1.999 0.100 | -0.143 0.248 0.011 | 0.066
## 4 | 0.171 0.309 0.021 | -0.590 4.226 0.252 | -0.212
## 5 | 0.299 0.947 0.039 | -0.545 3.610 0.131 | 0.467
## 6 | -0.266 0.748 0.039 | -0.113 0.155 0.007 | 0.019
## 7 | -0.196 0.408 0.024 | 0.157 0.299 0.016 | 0.120
## 8 | -0.327 1.132 0.051 | 0.315 1.208 0.047 | 0.419
## 9 | -0.326 1.125 0.066 | 0.219 0.585 0.030 | 0.237
## 10 | 0.122 0.156 0.010 | 0.090 0.097 0.005 | -0.059
## ctr cos2
## 1 3.156 0.094 |
## 2 0.002 0.000 |
## 3 0.062 0.002 |
## 4 0.631 0.033 |
## 5 3.054 0.096 |
## 6 0.005 0.000 |
## 7 0.202 0.009 |
## 8 2.448 0.083 |
## 9 0.785 0.035 |
## 10 0.048 0.002 |
##
## Categories (the 10 first)
## Dim.1 ctr cos2 v.test Dim.2 ctr cos2
## B_Biosec_0 | -0.349 0.800 0.053 -1.490 | 1.017 7.776 0.448
## B_Biosec_1 | 0.151 0.347 0.053 1.490 | -0.441 3.370 0.448
## B_Biosecok_0 | -0.258 0.737 0.070 -1.709 | 0.814 8.429 0.694
## B_Biosecok_1 | 0.270 0.772 0.070 1.709 | -0.853 8.830 0.694
## B_Biosec_012.NA | -0.865 0.754 0.036 -1.237 | -2.035 4.790 0.202
## B_Biosec_012_0 | -0.349 0.800 0.053 -1.490 | 1.017 7.776 0.448
## B_Biosec_012_1 | -0.032 0.006 0.000 -0.122 | 0.333 0.706 0.038
## B_Biosec_012_2 | 0.390 1.301 0.099 2.042 | -0.754 5.587 0.372
## B_Pests_0 | -0.417 0.701 0.040 -1.291 | 0.158 0.115 0.006
## B_Pests_1 | 0.095 0.160 0.040 1.291 | -0.036 0.026 0.006
## v.test Dim.3 ctr cos2 v.test
## B_Biosec_0 4.338 | 0.706 4.309 0.216 3.011 |
## B_Biosec_1 -4.338 | -0.306 1.867 0.216 -3.011 |
## B_Biosecok_0 5.398 | 0.027 0.011 0.001 0.180 |
## B_Biosecok_1 -5.398 | -0.028 0.011 0.001 -0.180 |
## B_Biosec_012.NA -2.913 | 1.270 2.145 0.079 1.817 |
## B_Biosec_012_0 4.338 | 0.706 4.309 0.216 3.011 |
## B_Biosec_012_1 1.266 | -0.972 6.909 0.324 -3.691 |
## B_Biosec_012_2 -3.950 | -0.060 0.041 0.002 -0.317 |
## B_Pests_0 0.488 | 0.448 1.069 0.046 1.389 |
## B_Pests_1 -0.488 | -0.102 0.244 0.046 -1.389 |
##
## Categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## B_Biosec | 0.053 0.448 0.216 |
## B_Biosecok | 0.070 0.694 0.001 |
## B_Biosec_012 | 0.132 0.758 0.468 |
## B_Pests | 0.040 0.006 0.046 |
## B_Entrancehuman | 0.068 0.009 0.039 |
## B_Entranceanimal | 0.139 0.015 0.020 |
## B_Handswash | 0.174 0.017 0.077 |
## B_Bootswash | 0.225 0.000 0.043 |
## B_Loadingbay | 0.047 0.008 0.001 |
## B_Entrancedriver | 0.051 0.003 0.014 |
##
## Supplementary categories
## Dim.1 cos2 v.test Dim.2 cos2 v.test Dim.3
## OUT_JOKUHYLK_01.NA | 0.052 0.000 0.135 | -0.126 0.003 -0.328 | 0.101
## OUT_JOKUHYLK_01_1 | -0.225 0.040 -1.295 | 0.008 0.000 0.044 | 0.170
## OUT_JOKUHYLK_01_2 | 0.220 0.035 1.209 | 0.034 0.001 0.186 | -0.214
## cos2 v.test
## OUT_JOKUHYLK_01.NA 0.002 0.264 |
## OUT_JOKUHYLK_01_1 0.023 0.982 |
## OUT_JOKUHYLK_01_2 0.033 -1.174 |
##
## Supplementary categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## OUT_JOKUHYLK_01 | 0.043 0.003 0.033 |
##
## Supplementary continuous variables
## Dim.1 Dim.2 Dim.3
## OUT_SOWmortpro | 0.397 | -0.264 | 0.034 |
## OUT_SOWcullpro | 0.363 | -0.075 | 0.063 |
To visualize the percentage of inertia explained by each MCA dimension:
eig.val <- res_mca$eig
barplot(eig.val[, 2],
names.arg = 1:nrow(eig.val),
main = "Variances Explained by Dimensions (%)",
xlab = "Principal Dimensions",
ylab = "Percentage of variances",
col ="steelblue")
# Add connected line segments to the plot
lines(x = 1:nrow(eig.val), eig.val[, 2],
type = "b", pch = 19, col = "red")
res <- explor::prepare_results(res_mca)
explor::MCA_var_plot(res, xax = 1, yax = 2,
var_sup = TRUE, var_lab_min_contrib = 0,
col_var = "Variable", symbol_var = "Type",
size_var = NULL, size_range = c(10, 300),
labels_size = 10, point_size = 56,
transitions = TRUE, labels_positions = NULL)
res <- explor::prepare_results(res_mca)
explor::MCA_ind_plot(res, xax = 1, yax = 2,ind_sup = FALSE,
lab_var = NULL, , ind_lab_min_contrib = 0,
col_var = NULL, labels_size = 9,
point_opacity = 0.5, opacity_var = NULL, point_size = 64,
ellipses = FALSE, transitions = TRUE, labels_positions = NULL)
fviz_mca_var(res_mca, choice = "quanti.sup",
ggtheme = theme_minimal())
## ```{r, echo = FALSE}
## res.hcpc = HCPC(res, nb.clust = -1, graph = FALSE)
## ```
##
## ```
## drawn <-
## c("43", "42", "11", "16", "4", "22", "20", "15", "30", "38")
## par(mar = c(4.1, 4.1, 1.1, 2.1))
## plot.HCPC(res.hcpc, choice = 'map', draw.tree = FALSE, select = drawn, title = '')
## ```
##
## **Figure - Ascending Hierarchical Classification of the individuals.**
## *The classification made on individuals reveals 6 clusters.*
##
##
## The 1st cluster is made of individuals such as *16*. This group is characterized by :
##
## - high frequency for the factors *B_carcasstruckenter=B_carcasstruckenter_2*, *B_biosecsum=B_biosecsum_7* and *B_Biosec_012=B_Biosec_012.NA* (factors are sorted from the most common).
##
## The cluster 2 is made of individuals such as*. This group is characterized by11* and *11*. :
##
## - high frequency for the factors *B_Biosec_012=B_Biosec_012_0*, *B_Biosec=B_Biosec_0*, *B_Biosecok=B_Biosecok_0*, *B_biosecsum=B_biosecsum_12*, *B_Handswash=B_Handswash_0* and *B_Entrancehuman=B_Entrancehuman_0* (factors are sorted from the most common).
## - low frequency for the factors *B_Biosec=B_Biosec_1*, *B_Biosecok=B_Biosecok_1*, *B_Handswash=B_Handswash_1*, *B_Entrancehuman=B_Entrancehuman_1* and *B_Biosec_012=B_Biosec_012_2* (factors are sorted from the rarest).
##
## The cluster 3 is made of individuals such as*. This group is characterized by22* and *22*. :
##
## - high frequency for the factors *B_Biosec_012=B_Biosec_012_1*, *B_biosecsum=B_biosecsum_13*, *B_cats=B_cats_yes*, *B_birds=B_birds_no*, *B_Loadingbay=B_Loadingbay_0*, *B_Biosecok=B_Biosecok_0* and *B_pestcontrol=catpoistrap* (factors are sorted from the most common).
## - low frequency for the factors *B_Biosec_012=B_Biosec_012_2*, *B_Loadingbay=B_Loadingbay_1*, *B_cats=B_cats_no* and *B_Biosecok=B_Biosecok_1* (factors are sorted from the rarest).
##
## The cluster 4 is made of individuals such as*. This group is characterized by4* and *4*. :
##
## - high frequency for the factors *B_Biosecok=B_Biosecok_1*, *B_Biosec_012=B_Biosec_012_2*, *B_Biosec=B_Biosec_1*, *B_cats=B_cats_no*, *B_biosecsum=B_biosecsum_16* and *B_Handswash=B_Handswash_1* (factors are sorted from the most common).
## - low frequency for the factors *B_Biosecok=B_Biosecok_0*, *B_Biosec=B_Biosec_0*, *B_Biosec_012=B_Biosec_012_0*, *B_cats=B_cats_yes* and *B_Handswash=B_Handswash_0* (factors are sorted from the rarest).
##
## The cluster 5 is made of individuals sharing :
##
## - high frequency for the factors *B_biosecsum=B_biosecsum_19* and *B_pestcontrol=catdogpoistrapfirm* (factors are sorted from the most common).
##
## The cluster 6 is made of individuals such as*. This group is characterized by42* and *42*. :
##
## - high frequency for the factors *B_cats=B_cats_noinfo*, *B_pestsigns=B_pestsigns_noinfo*, *B_birds=B_birds_noinfo*, *B_pets_in=B_pets_in_noinfo*, *B_pestcontrol=trap* and *B_pestcontrolplan=B_pestcontrolplan_noinfo* (factors are sorted from the most common).
## **Results for the Hierarchical Clustering on Principal Components**
## name
## 1 "$data.clust"
## 2 "$desc.var"
## 3 "$desc.var$test.chi2"
## 4 "$desc.axes$category"
## 5 "$desc.axes"
## 6 "$desc.axes$quanti.var"
## 7 "$desc.axes$quanti"
## 8 "$desc.ind"
## 9 "$desc.ind$para"
## 10 "$desc.ind$dist"
## 11 "$call"
## 12 "$call$t"
## description
## 1 "dataset with the cluster of the individuals"
## 2 "description of the clusters by the variables"
## 3 "description of the cluster var. by the categorical var."
## 4 "description of the clusters by the categories."
## 5 "description of the clusters by the dimensions"
## 6 "description of the cluster var. by the axes"
## 7 "description of the clusters by the axes"
## 8 "description of the clusters by the individuals"
## 9 "parangons of each clusters"
## 10 "specific individuals"
## 11 "summary statistics"
## 12 "description of the tree"
# load data
setwd("~/GitHub/tilataso")
library(readr)
library(FactoMineR)
library(FactoInvestigate)
library(factoextra)
library(dplyr)
library(explor)
med<-read.csv(file="manag.csv", header=TRUE)
med<-med%>%mutate_all(as.factor)
med$OUT_SOWcullpro<-as.numeric(med$OUT_SOWcullpro)
med$OUT_SOWmortpro<-as.numeric(med$OUT_SOWmortpro)
medcat<-med %>% select(-ends_with("pro"))
mednum<-med %>% select(ends_with("pro"))
colnames(medcat)
## [1] "MG_sowsincratespostmix" "MG_rootingmat"
## [3] "MG_mixing_1ok_2tmp_3notmp_4oktmp" "MG_owngilts"
## [5] "MG_owngilts.1" "MG_giltpurchage_NUM"
## [7] "MG_giltchangebeforeins" "MG_giltflush"
## [9] "MG_giltboarstart" "MG_giltinsage"
## [11] "MG_heatgroup" "MG_heatdetec_startNUM"
## [13] "MG_heatmarkback" "MG_farmsemen"
## [15] "MG_insonce" "MG_instriple"
## [17] "MG_instriple.1" "MG_aveins"
## [19] "MG_nopregus" "MG_ToFarunitNUM"
## [21] "MG_Nestmatdays" "MG_nestmatamount"
## [23] "MG_nestmat" "MG_farassist"
## [25] "MG_piglet_rem_age" "MG_piglet_rem_amountCAT"
## [27] "MG_piglet_addfeedage" "MG_ind_feed"
## [29] "MG_PREG_toy" "MG_BR_toy"
## [31] "MG_FAR_toy" "OUT_SOWmortdic"
## [33] "OUT_SOWculldic" "OUT_JOKUHYLK_01"
library(tidyr)
gather(medcat) %>% ggplot(aes(value)) + facet_wrap("key", scales = "free") + geom_bar(fill="green") + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8))+ scale_fill_manual("key")
library(dplyr)
library(ggplot2)
out<-med %>% dplyr::select(ends_with("pro"))
#Matrix of plots
ggpairs(out, lower = list(combo = wrap("facethist", bins = 20)), title="Graphical overview of the 2 outcome variables")
library(tableone)
KreateTableOne = function(x, ...){
t1 = tableone::CreateTableOne(data=x, ...)
t2 = print(t1, quote=TRUE)
rownames(t2) = gsub(pattern='\\"', replacement='', rownames(t2))
colnames(t2) = gsub(pattern='\\"', replacement='', colnames(t2))
return(t2)
}
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table1 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWmortdic')
table1%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow mortality") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 23 | 20 | ||
| MG_sowsincratespostmix (%) | 0.018 | |||
| 0 | 20 ( 87.0) | 9 ( 45.0) | ||
| 1 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2 | 1 ( 4.3) | 2 ( 10.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| 5 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.0) | ||
| noinfo | 0 ( 0.0) | 6 ( 30.0) | ||
| MG_rootingmat (%) | 0.146 | |||
| 0 | 4 ( 17.4) | 8 ( 40.0) | ||
| 1 | 10 ( 43.5) | 8 ( 40.0) | ||
| 2 | 9 ( 39.1) | 3 ( 15.0) | ||
| MG_rootingmat | 0 ( 0.0) | 1 ( 5.0) | ||
| MG_mixing_1ok_2tmp_3notmp_4oktmp (%) | 0.551 | |||
| 1 | 5 ( 21.7) | 2 ( 10.0) | ||
| 2 | 8 ( 34.8) | 11 ( 55.0) | ||
| 3 | 4 ( 17.4) | 3 ( 15.0) | ||
| 4 | 6 ( 26.1) | 4 ( 20.0) | ||
| MG_owngilts (%) | 0.895 | |||
| 0 | 8 ( 34.8) | 7 ( 35.0) | ||
| 50 | 0 ( 0.0) | 1 ( 5.0) | ||
| 70 | 1 ( 4.3) | 0 ( 0.0) | ||
| 80 | 1 ( 4.3) | 1 ( 5.0) | ||
| 90 | 2 ( 8.7) | 1 ( 5.0) | ||
| 95 | 1 ( 4.3) | 1 ( 5.0) | ||
| 100 | 10 ( 43.5) | 9 ( 45.0) | ||
| MG_owngilts.1 = 1 (%) | 15 ( 65.2) | 13 ( 65.0) | 1.000 | |
| MG_giltpurchage_NUM (%) | 0.663 | |||
| 0 | 12 ( 52.2) | 13 ( 65.0) | ||
| 3 | 2 ( 8.7) | 1 ( 5.0) | ||
| 4 | 1 ( 4.3) | 1 ( 5.0) | ||
| 5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 6 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7 | 4 ( 17.4) | 2 ( 10.0) | ||
| 8 | 0 ( 0.0) | 2 ( 10.0) | ||
| 11 | 1 ( 4.3) | 0 ( 0.0) | ||
| 12 | 1 ( 4.3) | 0 ( 0.0) | ||
| MG_giltchangebeforeins = 1 (%) | 8 ( 34.8) | 10 ( 50.0) | 0.485 | |
| MG_giltflush (%) | 0.584 | |||
| 0 | 9 ( 39.1) | 9 ( 45.0) | ||
| 1 | 8 ( 34.8) | 8 ( 40.0) | ||
| noinfo | 4 ( 17.4) | 3 ( 15.0) | ||
| noneed | 2 ( 8.7) | 0 ( 0.0) | ||
| MG_giltboarstart (%) | 0.103 | |||
| 0 | 2 ( 8.7) | 0 ( 0.0) | ||
| 3 | 1 ( 4.3) | 0 ( 0.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.0) | ||
| 6 | 1 ( 4.3) | 2 ( 10.0) | ||
| 6,5 | 3 ( 13.0) | 0 ( 0.0) | ||
| 7 | 3 ( 13.0) | 9 ( 45.0) | ||
| 7,5 | 3 ( 13.0) | 4 ( 20.0) | ||
| 8 | 1 ( 4.3) | 0 ( 0.0) | ||
| noinfo | 9 ( 39.1) | 4 ( 20.0) | ||
| MG_giltinsage (%) | 0.248 | |||
| 0 | 2 ( 8.7) | 0 ( 0.0) | ||
| 7 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7,5 | 1 ( 4.3) | 1 ( 5.0) | ||
| 8 | 12 ( 52.2) | 11 ( 55.0) | ||
| 8,5 | 0 ( 0.0) | 4 ( 20.0) | ||
| 9,5 | 1 ( 4.3) | 1 ( 5.0) | ||
| noinfo | 6 ( 26.1) | 3 ( 15.0) | ||
| MG_heatgroup (%) | 0.429 | |||
| 0 | 3 ( 13.0) | 2 ( 10.0) | ||
| 1 | 15 ( 65.2) | 10 ( 50.0) | ||
| noinfo | 5 ( 21.7) | 8 ( 40.0) | ||
| MG_heatdetec_startNUM (%) | 0.387 | |||
| 0 | 7 ( 30.4) | 5 ( 25.0) | ||
| 1 | 3 ( 13.0) | 2 ( 10.0) | ||
| 3 | 0 ( 0.0) | 3 ( 15.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 2 ( 8.7) | 2 ( 10.0) | ||
| noinfo | 11 ( 47.8) | 7 ( 35.0) | ||
| MG_heatmarkback (%) | 0.033 | |||
| 0 | 6 ( 26.1) | 0 ( 0.0) | ||
| 1 | 14 ( 60.9) | 14 ( 70.0) | ||
| noinfo | 3 ( 13.0) | 6 ( 30.0) | ||
| MG_artinspro (%) | 0.522 | |||
| 20 | 1 ( 4.3) | 1 ( 5.0) | ||
| 77 | 1 ( 4.3) | 0 ( 0.0) | ||
| 80 | 0 ( 0.0) | 1 ( 5.0) | ||
| 85 | 0 ( 0.0) | 1 ( 5.0) | ||
| 90 | 2 ( 8.7) | 2 ( 10.0) | ||
| 98 | 2 ( 8.7) | 1 ( 5.0) | ||
| 99 | 3 ( 13.0) | 0 ( 0.0) | ||
| 100 | 14 ( 60.9) | 14 ( 70.0) | ||
| MG_farmsemen (%) | 0.413 | |||
| 0 | 18 ( 78.3) | 15 ( 75.0) | ||
| 20 | 1 ( 4.3) | 0 ( 0.0) | ||
| 50 | 0 ( 0.0) | 1 ( 5.0) | ||
| 80 | 0 ( 0.0) | 2 ( 10.0) | ||
| 90 | 1 ( 4.3) | 0 ( 0.0) | ||
| 95 | 1 ( 4.3) | 0 ( 0.0) | ||
| 100 | 2 ( 8.7) | 2 ( 10.0) | ||
| MG_insonce (%) | 0.601 | |||
| 0 | 10 ( 43.5) | 5 ( 25.0) | ||
| 1 | 1 ( 4.3) | 0 ( 0.0) | ||
| 10 | 4 ( 17.4) | 2 ( 10.0) | ||
| 19 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 25 | 0 ( 0.0) | 1 ( 5.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 5 ( 21.7) | 5 ( 25.0) | ||
| 65 | 0 ( 0.0) | 1 ( 5.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.0) | ||
| 8 | 1 ( 4.3) | 1 ( 5.0) | ||
| 80 | 0 ( 0.0) | 1 ( 5.0) | ||
| noinfo | 1 ( 4.3) | 1 ( 5.0) | ||
| MG_instriple (%) | 0.630 | |||
| 0 | 7 ( 30.4) | 4 ( 20.0) | ||
| 1 | 1 ( 4.3) | 2 ( 10.0) | ||
| 10 | 5 ( 21.7) | 6 ( 30.0) | ||
| 15 | 0 ( 0.0) | 2 ( 10.0) | ||
| 2 | 1 ( 4.3) | 0 ( 0.0) | ||
| 3 | 1 ( 4.3) | 1 ( 5.0) | ||
| 30 | 1 ( 4.3) | 0 ( 0.0) | ||
| 33 | 0 ( 0.0) | 1 ( 5.0) | ||
| 5 | 6 ( 26.1) | 3 ( 15.0) | ||
| noinfo | 1 ( 4.3) | 1 ( 5.0) | ||
| MG_instriple.1 (%) | 0.894 | |||
| 0 | 7 ( 30.4) | 4 ( 20.0) | ||
| 1 | 14 ( 60.9) | 14 ( 70.0) | ||
| 2 | 1 ( 4.3) | 1 ( 5.0) | ||
| noinfo | 1 ( 4.3) | 1 ( 5.0) | ||
| MG_aveins (%) | 0.299 | |||
| 1 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2 | 23 (100.0) | 18 ( 90.0) | ||
| 2,1 | 0 ( 0.0) | 1 ( 5.0) | ||
| MG_nopregus (%) | 0.440 | |||
| 0 | 5 ( 21.7) | 2 ( 10.0) | ||
| 1 | 10 ( 43.5) | 12 ( 60.0) | ||
| 2 | 3 ( 13.0) | 4 ( 20.0) | ||
| noinfo | 5 ( 21.7) | 2 ( 10.0) | ||
| MG_ToFarunitNUM (%) | 0.686 | |||
| 3 | 4 ( 17.4) | 3 ( 15.0) | ||
| 4 | 3 ( 13.0) | 4 ( 20.0) | ||
| 5 | 7 ( 30.4) | 7 ( 35.0) | ||
| 6 | 2 ( 8.7) | 0 ( 0.0) | ||
| 7 | 6 ( 26.1) | 6 ( 30.0) | ||
| noinfo | 1 ( 4.3) | 0 ( 0.0) | ||
| MG_Nestmatdays (%) | 0.294 | |||
| 0 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 1 ( 4.3) | 2 ( 10.0) | ||
| 2 | 0 ( 0.0) | 5 ( 25.0) | ||
| 3 | 5 ( 21.7) | 2 ( 10.0) | ||
| 4 | 3 ( 13.0) | 4 ( 20.0) | ||
| 5 | 4 ( 17.4) | 2 ( 10.0) | ||
| 6 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7 | 4 ( 17.4) | 2 ( 10.0) | ||
| noinfo | 4 ( 17.4) | 2 ( 10.0) | ||
| MG_nestmatamount (%) | 0.866 | |||
| 0 | 0 ( 0.0) | 1 ( 5.0) | ||
| 1 | 2 ( 8.7) | 2 ( 10.0) | ||
| 2 | 13 ( 56.5) | 11 ( 55.0) | ||
| 3 | 5 ( 21.7) | 4 ( 20.0) | ||
| noinfo | 3 ( 13.0) | 2 ( 10.0) | ||
| MG_nestmat (%) | 0.462 | |||
| _CUT | 0 ( 0.0) | 2 ( 10.0) | ||
| _NWS | 3 ( 13.0) | 2 ( 10.0) | ||
| noinfo | 6 ( 26.1) | 7 ( 35.0) | ||
| STR | 8 ( 34.8) | 6 ( 30.0) | ||
| STR_CUT | 5 ( 21.7) | 2 ( 10.0) | ||
| STR_CUT_NWS | 1 ( 4.3) | 0 ( 0.0) | ||
| STR_NWS | 0 ( 0.0) | 1 ( 5.0) | ||
| MG_farassist (%) | 0.350 | |||
| 0 ( 0.0) | 2 ( 10.0) | |||
| _GLO_LUBR | 8 ( 34.8) | 7 ( 35.0) | ||
| _HANDWASH_GLO_LUBR | 1 ( 4.3) | 0 ( 0.0) | ||
| GLO_LUBR | 0 ( 0.0) | 1 ( 5.0) | ||
| WASH_GLO_LUBR | 8 ( 34.8) | 5 ( 25.0) | ||
| WASH_HANDWASH_GLO_LUBR | 4 ( 17.4) | 5 ( 25.0) | ||
| WASH_HANDWASH_LUBR | 2 ( 8.7) | 0 ( 0.0) | ||
| MG_piglet_rem_age (%) | 0.507 | |||
| 1 ( 4.3) | 1 ( 5.0) | |||
| 0,5 | 10 ( 43.5) | 9 ( 45.0) | ||
| 0,75 | 0 ( 0.0) | 2 ( 10.0) | ||
| 1 | 6 ( 26.1) | 4 ( 20.0) | ||
| 1,5 | 3 ( 13.0) | 1 ( 5.0) | ||
| 2 | 0 ( 0.0) | 1 ( 5.0) | ||
| 2,5 | 2 ( 8.7) | 0 ( 0.0) | ||
| no | 1 ( 4.3) | 1 ( 5.0) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.0) | ||
| MG_piglet_rem_amountCAT (%) | 0.004 | |||
| 0 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 10 ( 43.5) | 4 ( 20.0) | ||
| 2 | 9 ( 39.1) | 1 ( 5.0) | ||
| 3 | 0 ( 0.0) | 6 ( 30.0) | ||
| 4 | 2 ( 8.7) | 5 ( 25.0) | ||
| noinfo | 1 ( 4.3) | 3 ( 15.0) | ||
| MG_piglet_addfeedage (%) | 0.481 | |||
| <7 | 7 ( 30.4) | 4 ( 20.0) | ||
| >20 | 1 ( 4.3) | 0 ( 0.0) | ||
| 7-14 | 6 ( 26.1) | 9 ( 45.0) | ||
| noinfo | 9 ( 39.1) | 7 ( 35.0) | ||
| MG_ind_feed = 1 (%) | 17 ( 73.9) | 14 ( 70.0) | 1.000 | |
| MG_PREG_toy (%) | 0.272 | |||
| 0 | 1 ( 4.3) | 3 ( 15.0) | ||
| 1 | 3 ( 13.0) | 6 ( 30.0) | ||
| 2 | 10 ( 43.5) | 6 ( 30.0) | ||
| 3 | 7 ( 30.4) | 5 ( 25.0) | ||
| noinfo | 2 ( 8.7) | 0 ( 0.0) | ||
| MG_BR_toy (%) | 0.040 | |||
| 0 | 4 ( 17.4) | 1 ( 5.0) | ||
| 1 | 3 ( 13.0) | 10 ( 50.0) | ||
| 2 | 6 ( 26.1) | 2 ( 10.0) | ||
| 3 | 4 ( 17.4) | 4 ( 20.0) | ||
| group | 4 ( 17.4) | 0 ( 0.0) | ||
| noinfo | 2 ( 8.7) | 3 ( 15.0) | ||
| MG_FAR_toy (%) | 0.525 | |||
| 2 ( 8.7) | 0 ( 0.0) | |||
| 0 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 6 ( 26.1) | 3 ( 15.0) | ||
| 2 | 11 ( 47.8) | 14 ( 70.0) | ||
| 3 | 2 ( 8.7) | 2 ( 10.0) | ||
| noinfo | 1 ( 4.3) | 0 ( 0.0) | ||
| OUT_SOWmortpro (mean (sd)) | 4.74 (2.12) | 13.35 (3.27) | <0.001 | |
| OUT_SOWmortdic = 1 (%) | 0 ( 0.0) | 20 (100.0) | <0.001 | |
| OUT_SOWcullpro (mean (sd)) | 8.81 (6.62) | 17.89 (6.29) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 5 ( 23.8) | 14 ( 77.8) | 0.002 | |
| OUT_JOKUHYLK_01 = 2 (%) | 6 ( 31.6) | 12 ( 66.7) | 0.071 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table2 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWculldic')
table2%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow cull") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 20 | 19 | ||
| MG_sowsincratespostmix (%) | NaN | |||
| 0 | 16 ( 80.0) | 10 ( 52.6) | ||
| 1 | 0 ( 0.0) | 2 ( 10.5) | ||
| 2 | 2 ( 10.0) | 1 ( 5.3) | ||
| 3 | 1 ( 5.0) | 0 ( 0.0) | ||
| 5 | 0 ( 0.0) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.3) | ||
| noinfo | 1 ( 5.0) | 5 ( 26.3) | ||
| MG_rootingmat (%) | 0.436 | |||
| 0 | 5 ( 25.0) | 6 ( 31.6) | ||
| 1 | 8 ( 40.0) | 9 ( 47.4) | ||
| 2 | 7 ( 35.0) | 3 ( 15.8) | ||
| MG_rootingmat | 0 ( 0.0) | 1 ( 5.3) | ||
| MG_mixing_1ok_2tmp_3notmp_4oktmp (%) | 0.449 | |||
| 1 | 4 ( 20.0) | 2 ( 10.5) | ||
| 2 | 8 ( 40.0) | 10 ( 52.6) | ||
| 3 | 5 ( 25.0) | 2 ( 10.5) | ||
| 4 | 3 ( 15.0) | 5 ( 26.3) | ||
| MG_owngilts (%) | NaN | |||
| 0 | 8 ( 40.0) | 6 ( 31.6) | ||
| 50 | 0 ( 0.0) | 0 ( 0.0) | ||
| 70 | 1 ( 5.0) | 0 ( 0.0) | ||
| 80 | 1 ( 5.0) | 1 ( 5.3) | ||
| 90 | 2 ( 10.0) | 1 ( 5.3) | ||
| 95 | 0 ( 0.0) | 2 ( 10.5) | ||
| 100 | 8 ( 40.0) | 9 ( 47.4) | ||
| MG_owngilts.1 = 1 (%) | 12 ( 60.0) | 13 ( 68.4) | 0.831 | |
| MG_giltpurchage_NUM (%) | NaN | |||
| 0 | 10 ( 50.0) | 13 ( 68.4) | ||
| 3 | 2 ( 10.0) | 1 ( 5.3) | ||
| 4 | 1 ( 5.0) | 1 ( 5.3) | ||
| 5 | 2 ( 10.0) | 0 ( 0.0) | ||
| 6 | 0 ( 0.0) | 0 ( 0.0) | ||
| 7 | 3 ( 15.0) | 3 ( 15.8) | ||
| 8 | 0 ( 0.0) | 1 ( 5.3) | ||
| 11 | 1 ( 5.0) | 0 ( 0.0) | ||
| 12 | 1 ( 5.0) | 0 ( 0.0) | ||
| MG_giltchangebeforeins = 1 (%) | 7 ( 35.0) | 10 ( 52.6) | 0.431 | |
| MG_giltflush (%) | 0.426 | |||
| 0 | 6 ( 30.0) | 9 ( 47.4) | ||
| 1 | 8 ( 40.0) | 7 ( 36.8) | ||
| noinfo | 4 ( 20.0) | 3 ( 15.8) | ||
| noneed | 2 ( 10.0) | 0 ( 0.0) | ||
| MG_giltboarstart (%) | 0.253 | |||
| 0 | 2 ( 10.0) | 0 ( 0.0) | ||
| 3 | 1 ( 5.0) | 0 ( 0.0) | ||
| 4 | 1 ( 5.0) | 0 ( 0.0) | ||
| 6 | 1 ( 5.0) | 1 ( 5.3) | ||
| 6,5 | 3 ( 15.0) | 0 ( 0.0) | ||
| 7 | 4 ( 20.0) | 7 ( 36.8) | ||
| 7,5 | 2 ( 10.0) | 5 ( 26.3) | ||
| 8 | 1 ( 5.0) | 0 ( 0.0) | ||
| noinfo | 5 ( 25.0) | 6 ( 31.6) | ||
| MG_giltinsage (%) | 0.275 | |||
| 0 | 2 ( 10.0) | 0 ( 0.0) | ||
| 7 | 1 ( 5.0) | 0 ( 0.0) | ||
| 7,5 | 0 ( 0.0) | 2 ( 10.5) | ||
| 8 | 10 ( 50.0) | 11 ( 57.9) | ||
| 8,5 | 1 ( 5.0) | 3 ( 15.8) | ||
| 9,5 | 1 ( 5.0) | 0 ( 0.0) | ||
| noinfo | 5 ( 25.0) | 3 ( 15.8) | ||
| MG_heatgroup (%) | 0.327 | |||
| 0 | 3 ( 15.0) | 2 ( 10.5) | ||
| 1 | 13 ( 65.0) | 9 ( 47.4) | ||
| noinfo | 4 ( 20.0) | 8 ( 42.1) | ||
| MG_heatdetec_startNUM (%) | 0.524 | |||
| 0 | 5 ( 25.0) | 7 ( 36.8) | ||
| 1 | 3 ( 15.0) | 2 ( 10.5) | ||
| 3 | 1 ( 5.0) | 1 ( 5.3) | ||
| 4 | 0 ( 0.0) | 1 ( 5.3) | ||
| 5 | 1 ( 5.0) | 3 ( 15.8) | ||
| noinfo | 10 ( 50.0) | 5 ( 26.3) | ||
| MG_heatmarkback (%) | 0.049 | |||
| 0 | 5 ( 25.0) | 0 ( 0.0) | ||
| 1 | 11 ( 55.0) | 16 ( 84.2) | ||
| noinfo | 4 ( 20.0) | 3 ( 15.8) | ||
| MG_artinspro (%) | NaN | |||
| 20 | 0 ( 0.0) | 2 ( 10.5) | ||
| 77 | 1 ( 5.0) | 0 ( 0.0) | ||
| 80 | 0 ( 0.0) | 0 ( 0.0) | ||
| 85 | 0 ( 0.0) | 1 ( 5.3) | ||
| 90 | 1 ( 5.0) | 2 ( 10.5) | ||
| 98 | 2 ( 10.0) | 1 ( 5.3) | ||
| 99 | 3 ( 15.0) | 0 ( 0.0) | ||
| 100 | 13 ( 65.0) | 13 ( 68.4) | ||
| MG_farmsemen (%) | 0.335 | |||
| 0 | 17 ( 85.0) | 13 ( 68.4) | ||
| 20 | 1 ( 5.0) | 0 ( 0.0) | ||
| 50 | 0 ( 0.0) | 1 ( 5.3) | ||
| 80 | 0 ( 0.0) | 2 ( 10.5) | ||
| 90 | 1 ( 5.0) | 0 ( 0.0) | ||
| 95 | 0 ( 0.0) | 1 ( 5.3) | ||
| 100 | 1 ( 5.0) | 2 ( 10.5) | ||
| MG_insonce (%) | 0.269 | |||
| 0 | 6 ( 30.0) | 8 ( 42.1) | ||
| 1 | 1 ( 5.0) | 0 ( 0.0) | ||
| 10 | 2 ( 10.0) | 4 ( 21.1) | ||
| 19 | 0 ( 0.0) | 1 ( 5.3) | ||
| 2 | 1 ( 5.0) | 0 ( 0.0) | ||
| 25 | 0 ( 0.0) | 1 ( 5.3) | ||
| 3 | 0 ( 0.0) | 1 ( 5.3) | ||
| 5 | 6 ( 30.0) | 1 ( 5.3) | ||
| 65 | 0 ( 0.0) | 1 ( 5.3) | ||
| 7 | 0 ( 0.0) | 1 ( 5.3) | ||
| 8 | 2 ( 10.0) | 0 ( 0.0) | ||
| 80 | 1 ( 5.0) | 0 ( 0.0) | ||
| noinfo | 1 ( 5.0) | 1 ( 5.3) | ||
| MG_instriple (%) | 0.596 | |||
| 0 | 6 ( 30.0) | 4 ( 21.1) | ||
| 1 | 2 ( 10.0) | 1 ( 5.3) | ||
| 10 | 4 ( 20.0) | 6 ( 31.6) | ||
| 15 | 0 ( 0.0) | 2 ( 10.5) | ||
| 2 | 1 ( 5.0) | 0 ( 0.0) | ||
| 3 | 1 ( 5.0) | 1 ( 5.3) | ||
| 30 | 0 ( 0.0) | 1 ( 5.3) | ||
| 33 | 0 ( 0.0) | 1 ( 5.3) | ||
| 5 | 5 ( 25.0) | 2 ( 10.5) | ||
| noinfo | 1 ( 5.0) | 1 ( 5.3) | ||
| MG_instriple.1 (%) | 0.491 | |||
| 0 | 6 ( 30.0) | 4 ( 21.1) | ||
| 1 | 13 ( 65.0) | 12 ( 63.2) | ||
| 2 | 0 ( 0.0) | 2 ( 10.5) | ||
| noinfo | 1 ( 5.0) | 1 ( 5.3) | ||
| MG_aveins (%) | 0.330 | |||
| 1 | 0 ( 0.0) | 1 ( 5.3) | ||
| 2 | 20 (100.0) | 17 ( 89.5) | ||
| 2,1 | 0 ( 0.0) | 1 ( 5.3) | ||
| MG_nopregus (%) | 0.269 | |||
| 0 | 5 ( 25.0) | 1 ( 5.3) | ||
| 1 | 10 ( 50.0) | 10 ( 52.6) | ||
| 2 | 2 ( 10.0) | 5 ( 26.3) | ||
| noinfo | 3 ( 15.0) | 3 ( 15.8) | ||
| MG_ToFarunitNUM (%) | 0.259 | |||
| 3 | 4 ( 20.0) | 1 ( 5.3) | ||
| 4 | 3 ( 15.0) | 4 ( 21.1) | ||
| 5 | 7 ( 35.0) | 7 ( 36.8) | ||
| 6 | 2 ( 10.0) | 0 ( 0.0) | ||
| 7 | 3 ( 15.0) | 7 ( 36.8) | ||
| noinfo | 1 ( 5.0) | 0 ( 0.0) | ||
| MG_Nestmatdays (%) | 0.243 | |||
| 0 | 0 ( 0.0) | 2 ( 10.5) | ||
| 1 | 1 ( 5.0) | 2 ( 10.5) | ||
| 2 | 1 ( 5.0) | 3 ( 15.8) | ||
| 3 | 5 ( 25.0) | 0 ( 0.0) | ||
| 4 | 3 ( 15.0) | 4 ( 21.1) | ||
| 5 | 4 ( 20.0) | 2 ( 10.5) | ||
| 6 | 1 ( 5.0) | 0 ( 0.0) | ||
| 7 | 2 ( 10.0) | 3 ( 15.8) | ||
| noinfo | 3 ( 15.0) | 3 ( 15.8) | ||
| MG_nestmatamount (%) | 0.483 | |||
| 0 | 0 ( 0.0) | 1 ( 5.3) | ||
| 1 | 2 ( 10.0) | 0 ( 0.0) | ||
| 2 | 10 ( 50.0) | 12 ( 63.2) | ||
| 3 | 5 ( 25.0) | 4 ( 21.1) | ||
| noinfo | 3 ( 15.0) | 2 ( 10.5) | ||
| MG_nestmat (%) | 0.587 | |||
| _CUT | 1 ( 5.0) | 1 ( 5.3) | ||
| _NWS | 2 ( 10.0) | 2 ( 10.5) | ||
| noinfo | 5 ( 25.0) | 8 ( 42.1) | ||
| STR | 8 ( 40.0) | 4 ( 21.1) | ||
| STR_CUT | 2 ( 10.0) | 4 ( 21.1) | ||
| STR_CUT_NWS | 1 ( 5.0) | 0 ( 0.0) | ||
| STR_NWS | 1 ( 5.0) | 0 ( 0.0) | ||
| MG_farassist (%) | 0.517 | |||
| 0 ( 0.0) | 2 ( 10.5) | |||
| _GLO_LUBR | 9 ( 45.0) | 5 ( 26.3) | ||
| _HANDWASH_GLO_LUBR | 1 ( 5.0) | 0 ( 0.0) | ||
| GLO_LUBR | 0 ( 0.0) | 1 ( 5.3) | ||
| WASH_GLO_LUBR | 5 ( 25.0) | 6 ( 31.6) | ||
| WASH_HANDWASH_GLO_LUBR | 4 ( 20.0) | 4 ( 21.1) | ||
| WASH_HANDWASH_LUBR | 1 ( 5.0) | 1 ( 5.3) | ||
| MG_piglet_rem_age (%) | NaN | |||
| 1 ( 5.0) | 1 ( 5.3) | |||
| 0,5 | 4 ( 20.0) | 13 ( 68.4) | ||
| 0,75 | 2 ( 10.0) | 0 ( 0.0) | ||
| 1 | 7 ( 35.0) | 2 ( 10.5) | ||
| 1,5 | 3 ( 15.0) | 1 ( 5.3) | ||
| 2 | 0 ( 0.0) | 0 ( 0.0) | ||
| 2,5 | 2 ( 10.0) | 0 ( 0.0) | ||
| no | 1 ( 5.0) | 1 ( 5.3) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.3) | ||
| MG_piglet_rem_amountCAT (%) | 0.120 | |||
| 0 | 1 ( 5.0) | 1 ( 5.3) | ||
| 1 | 7 ( 35.0) | 4 ( 21.1) | ||
| 2 | 8 ( 40.0) | 2 ( 10.5) | ||
| 3 | 2 ( 10.0) | 4 ( 21.1) | ||
| 4 | 1 ( 5.0) | 5 ( 26.3) | ||
| noinfo | 1 ( 5.0) | 3 ( 15.8) | ||
| MG_piglet_addfeedage (%) | 0.389 | |||
| <7 | 7 ( 35.0) | 4 ( 21.1) | ||
| >20 | 1 ( 5.0) | 0 ( 0.0) | ||
| 7-14 | 5 ( 25.0) | 9 ( 47.4) | ||
| noinfo | 7 ( 35.0) | 6 ( 31.6) | ||
| MG_ind_feed = 1 (%) | 13 ( 65.0) | 15 ( 78.9) | 0.541 | |
| MG_PREG_toy (%) | 0.267 | |||
| 0 | 1 ( 5.0) | 3 ( 15.8) | ||
| 1 | 3 ( 15.0) | 4 ( 21.1) | ||
| 2 | 11 ( 55.0) | 4 ( 21.1) | ||
| 3 | 4 ( 20.0) | 7 ( 36.8) | ||
| noinfo | 1 ( 5.0) | 1 ( 5.3) | ||
| MG_BR_toy (%) | 0.130 | |||
| 0 | 4 ( 20.0) | 0 ( 0.0) | ||
| 1 | 4 ( 20.0) | 9 ( 47.4) | ||
| 2 | 5 ( 25.0) | 2 ( 10.5) | ||
| 3 | 4 ( 20.0) | 4 ( 21.1) | ||
| group | 2 ( 10.0) | 1 ( 5.3) | ||
| noinfo | 1 ( 5.0) | 3 ( 15.8) | ||
| MG_FAR_toy (%) | 0.774 | |||
| 1 ( 5.0) | 1 ( 5.3) | |||
| 0 | 1 ( 5.0) | 1 ( 5.3) | ||
| 1 | 4 ( 20.0) | 5 ( 26.3) | ||
| 2 | 12 ( 60.0) | 9 ( 47.4) | ||
| 3 | 1 ( 5.0) | 3 ( 15.8) | ||
| noinfo | 1 ( 5.0) | 0 ( 0.0) | ||
| OUT_SOWmortpro (mean (sd)) | 6.15 (3.57) | 11.53 (5.36) | 0.001 | |
| OUT_SOWmortdic = 1 (%) | 4 ( 20.0) | 14 ( 73.7) | 0.002 | |
| OUT_SOWcullpro (mean (sd)) | 6.40 (3.12) | 19.95 (4.55) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 0 ( 0.0) | 19 (100.0) | <0.001 | |
| OUT_JOKUHYLK_01 = 2 (%) | 8 ( 40.0) | 10 ( 58.8) | 0.417 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table3 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_JOKUHYLK_01')
table3%>%
kable("html", align = "rrr", caption = "Data variable summary strat by JOKUHYLK") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 1 | 2 | p | test | |
|---|---|---|---|---|
| n | 19 | 18 | ||
| MG_sowsincratespostmix (%) | NaN | |||
| 0 | 14 (73.7) | 10 ( 55.6) | ||
| 1 | 0 ( 0.0) | 2 ( 11.1) | ||
| 2 | 1 ( 5.3) | 2 ( 11.1) | ||
| 3 | 1 ( 5.3) | 0 ( 0.0) | ||
| 5 | 0 ( 0.0) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.6) | ||
| noinfo | 3 (15.8) | 3 ( 16.7) | ||
| MG_rootingmat (%) | 0.034 | |||
| 0 | 3 (15.8) | 8 ( 44.4) | ||
| 1 | 8 (42.1) | 8 ( 44.4) | ||
| 2 | 8 (42.1) | 1 ( 5.6) | ||
| MG_rootingmat | 0 ( 0.0) | 1 ( 5.6) | ||
| MG_mixing_1ok_2tmp_3notmp_4oktmp (%) | 0.039 | |||
| 1 | 5 (26.3) | 0 ( 0.0) | ||
| 2 | 10 (52.6) | 8 ( 44.4) | ||
| 3 | 1 ( 5.3) | 5 ( 27.8) | ||
| 4 | 3 (15.8) | 5 ( 27.8) | ||
| MG_owngilts (%) | NaN | |||
| 0 | 5 (26.3) | 9 ( 50.0) | ||
| 50 | 0 ( 0.0) | 0 ( 0.0) | ||
| 70 | 0 ( 0.0) | 1 ( 5.6) | ||
| 80 | 0 ( 0.0) | 2 ( 11.1) | ||
| 90 | 1 ( 5.3) | 1 ( 5.6) | ||
| 95 | 1 ( 5.3) | 1 ( 5.6) | ||
| 100 | 12 (63.2) | 4 ( 22.2) | ||
| MG_owngilts.1 = 1 (%) | 14 (73.7) | 9 ( 50.0) | 0.252 | |
| MG_giltpurchage_NUM (%) | NaN | |||
| 0 | 15 (78.9) | 7 ( 38.9) | ||
| 3 | 0 ( 0.0) | 3 ( 16.7) | ||
| 4 | 0 ( 0.0) | 2 ( 11.1) | ||
| 5 | 1 ( 5.3) | 1 ( 5.6) | ||
| 6 | 0 ( 0.0) | 0 ( 0.0) | ||
| 7 | 1 ( 5.3) | 4 ( 22.2) | ||
| 8 | 0 ( 0.0) | 1 ( 5.6) | ||
| 11 | 1 ( 5.3) | 0 ( 0.0) | ||
| 12 | 1 ( 5.3) | 0 ( 0.0) | ||
| MG_giltchangebeforeins = 1 (%) | 7 (36.8) | 10 ( 55.6) | 0.417 | |
| MG_giltflush (%) | 0.315 | |||
| 0 | 7 (36.8) | 7 ( 38.9) | ||
| 1 | 8 (42.1) | 6 ( 33.3) | ||
| noinfo | 2 (10.5) | 5 ( 27.8) | ||
| noneed | 2 (10.5) | 0 ( 0.0) | ||
| MG_giltboarstart (%) | 0.714 | |||
| 0 | 2 (10.5) | 0 ( 0.0) | ||
| 3 | 1 ( 5.3) | 0 ( 0.0) | ||
| 4 | 1 ( 5.3) | 0 ( 0.0) | ||
| 6 | 1 ( 5.3) | 1 ( 5.6) | ||
| 6,5 | 1 ( 5.3) | 2 ( 11.1) | ||
| 7 | 5 (26.3) | 6 ( 33.3) | ||
| 7,5 | 3 (15.8) | 3 ( 16.7) | ||
| 8 | 0 ( 0.0) | 1 ( 5.6) | ||
| noinfo | 5 (26.3) | 5 ( 27.8) | ||
| MG_giltinsage (%) | 0.529 | |||
| 0 | 2 (10.5) | 0 ( 0.0) | ||
| 7 | 0 ( 0.0) | 1 ( 5.6) | ||
| 7,5 | 1 ( 5.3) | 1 ( 5.6) | ||
| 8 | 10 (52.6) | 10 ( 55.6) | ||
| 8,5 | 1 ( 5.3) | 3 ( 16.7) | ||
| 9,5 | 1 ( 5.3) | 0 ( 0.0) | ||
| noinfo | 4 (21.1) | 3 ( 16.7) | ||
| MG_heatgroup (%) | 0.217 | |||
| 0 | 1 ( 5.3) | 4 ( 22.2) | ||
| 1 | 13 (68.4) | 8 ( 44.4) | ||
| noinfo | 5 (26.3) | 6 ( 33.3) | ||
| MG_heatdetec_startNUM (%) | 0.265 | |||
| 0 | 3 (15.8) | 7 ( 38.9) | ||
| 1 | 4 (21.1) | 1 ( 5.6) | ||
| 3 | 2 (10.5) | 0 ( 0.0) | ||
| 4 | 0 ( 0.0) | 1 ( 5.6) | ||
| 5 | 2 (10.5) | 2 ( 11.1) | ||
| noinfo | 8 (42.1) | 7 ( 38.9) | ||
| MG_heatmarkback (%) | 0.403 | |||
| 0 | 3 (15.8) | 2 ( 11.1) | ||
| 1 | 11 (57.9) | 14 ( 77.8) | ||
| noinfo | 5 (26.3) | 2 ( 11.1) | ||
| MG_artinspro (%) | NaN | |||
| 20 | 1 ( 5.3) | 1 ( 5.6) | ||
| 77 | 1 ( 5.3) | 0 ( 0.0) | ||
| 80 | 0 ( 0.0) | 0 ( 0.0) | ||
| 85 | 1 ( 5.3) | 0 ( 0.0) | ||
| 90 | 1 ( 5.3) | 1 ( 5.6) | ||
| 98 | 1 ( 5.3) | 1 ( 5.6) | ||
| 99 | 1 ( 5.3) | 2 ( 11.1) | ||
| 100 | 13 (68.4) | 13 ( 72.2) | ||
| MG_farmsemen (%) | 0.635 | |||
| 0 | 14 (73.7) | 14 ( 77.8) | ||
| 20 | 1 ( 5.3) | 0 ( 0.0) | ||
| 50 | 0 ( 0.0) | 1 ( 5.6) | ||
| 80 | 1 ( 5.3) | 1 ( 5.6) | ||
| 90 | 1 ( 5.3) | 0 ( 0.0) | ||
| 95 | 1 ( 5.3) | 0 ( 0.0) | ||
| 100 | 1 ( 5.3) | 2 ( 11.1) | ||
| MG_insonce (%) | 0.446 | |||
| 0 | 7 (36.8) | 6 ( 33.3) | ||
| 1 | 1 ( 5.3) | 0 ( 0.0) | ||
| 10 | 1 ( 5.3) | 4 ( 22.2) | ||
| 19 | 1 ( 5.3) | 0 ( 0.0) | ||
| 2 | 1 ( 5.3) | 0 ( 0.0) | ||
| 25 | 1 ( 5.3) | 0 ( 0.0) | ||
| 3 | 0 ( 0.0) | 1 ( 5.6) | ||
| 5 | 4 (21.1) | 3 ( 16.7) | ||
| 65 | 0 ( 0.0) | 1 ( 5.6) | ||
| 7 | 0 ( 0.0) | 1 ( 5.6) | ||
| 8 | 2 (10.5) | 0 ( 0.0) | ||
| 80 | 0 ( 0.0) | 1 ( 5.6) | ||
| noinfo | 1 ( 5.3) | 1 ( 5.6) | ||
| MG_instriple (%) | 0.368 | |||
| 0 | 3 (15.8) | 5 ( 27.8) | ||
| 1 | 2 (10.5) | 1 ( 5.6) | ||
| 10 | 4 (21.1) | 6 ( 33.3) | ||
| 15 | 0 ( 0.0) | 2 ( 11.1) | ||
| 2 | 1 ( 5.3) | 0 ( 0.0) | ||
| 3 | 1 ( 5.3) | 1 ( 5.6) | ||
| 30 | 1 ( 5.3) | 0 ( 0.0) | ||
| 33 | 0 ( 0.0) | 1 ( 5.6) | ||
| 5 | 6 (31.6) | 1 ( 5.6) | ||
| noinfo | 1 ( 5.3) | 1 ( 5.6) | ||
| MG_instriple.1 (%) | 0.841 | |||
| 0 | 3 (15.8) | 5 ( 27.8) | ||
| 1 | 14 (73.7) | 11 ( 61.1) | ||
| 2 | 1 ( 5.3) | 1 ( 5.6) | ||
| noinfo | 1 ( 5.3) | 1 ( 5.6) | ||
| MG_aveins (%) | 0.367 | |||
| 1 | 0 ( 0.0) | 1 ( 5.6) | ||
| 2 | 18 (94.7) | 17 ( 94.4) | ||
| 2,1 | 1 ( 5.3) | 0 ( 0.0) | ||
| MG_nopregus (%) | 0.142 | |||
| 0 | 5 (26.3) | 1 ( 5.6) | ||
| 1 | 7 (36.8) | 12 ( 66.7) | ||
| 2 | 5 (26.3) | 2 ( 11.1) | ||
| noinfo | 2 (10.5) | 3 ( 16.7) | ||
| MG_ToFarunitNUM (%) | 0.374 | |||
| 3 | 2 (10.5) | 3 ( 16.7) | ||
| 4 | 3 (15.8) | 4 ( 22.2) | ||
| 5 | 9 (47.4) | 4 ( 22.2) | ||
| 6 | 0 ( 0.0) | 2 ( 11.1) | ||
| 7 | 4 (21.1) | 5 ( 27.8) | ||
| noinfo | 1 ( 5.3) | 0 ( 0.0) | ||
| MG_Nestmatdays (%) | 0.723 | |||
| 0 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 2 (10.5) | 1 ( 5.6) | ||
| 2 | 2 (10.5) | 2 ( 11.1) | ||
| 3 | 3 (15.8) | 2 ( 11.1) | ||
| 4 | 3 (15.8) | 4 ( 22.2) | ||
| 5 | 4 (21.1) | 1 ( 5.6) | ||
| 6 | 0 ( 0.0) | 1 ( 5.6) | ||
| 7 | 3 (15.8) | 2 ( 11.1) | ||
| noinfo | 2 (10.5) | 4 ( 22.2) | ||
| MG_nestmatamount (%) | 0.224 | |||
| 0 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 2 (10.5) | 0 ( 0.0) | ||
| 2 | 12 (63.2) | 8 ( 44.4) | ||
| 3 | 4 (21.1) | 5 ( 27.8) | ||
| noinfo | 1 ( 5.3) | 4 ( 22.2) | ||
| MG_nestmat (%) | 0.530 | |||
| _CUT | 1 ( 5.3) | 1 ( 5.6) | ||
| _NWS | 1 ( 5.3) | 3 ( 16.7) | ||
| noinfo | 5 (26.3) | 7 ( 38.9) | ||
| STR | 6 (31.6) | 6 ( 33.3) | ||
| STR_CUT | 4 (21.1) | 1 ( 5.6) | ||
| STR_CUT_NWS | 1 ( 5.3) | 0 ( 0.0) | ||
| STR_NWS | 1 ( 5.3) | 0 ( 0.0) | ||
| MG_farassist (%) | 0.339 | |||
| 0 ( 0.0) | 2 ( 11.1) | |||
| _GLO_LUBR | 8 (42.1) | 6 ( 33.3) | ||
| _HANDWASH_GLO_LUBR | 1 ( 5.3) | 0 ( 0.0) | ||
| GLO_LUBR | 0 ( 0.0) | 1 ( 5.6) | ||
| WASH_GLO_LUBR | 4 (21.1) | 6 ( 33.3) | ||
| WASH_HANDWASH_GLO_LUBR | 4 (21.1) | 3 ( 16.7) | ||
| WASH_HANDWASH_LUBR | 2 (10.5) | 0 ( 0.0) | ||
| MG_piglet_rem_age (%) | NaN | |||
| 1 ( 5.3) | 1 ( 5.6) | |||
| 0,5 | 7 (36.8) | 9 ( 50.0) | ||
| 0,75 | 1 ( 5.3) | 1 ( 5.6) | ||
| 1 | 6 (31.6) | 3 ( 16.7) | ||
| 1,5 | 2 (10.5) | 2 ( 11.1) | ||
| 2 | 0 ( 0.0) | 0 ( 0.0) | ||
| 2,5 | 2 (10.5) | 0 ( 0.0) | ||
| no | 0 ( 0.0) | 1 ( 5.6) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.6) | ||
| MG_piglet_rem_amountCAT (%) | 0.715 | |||
| 0 | 0 ( 0.0) | 1 ( 5.6) | ||
| 1 | 7 (36.8) | 4 ( 22.2) | ||
| 2 | 5 (26.3) | 4 ( 22.2) | ||
| 3 | 3 (15.8) | 3 ( 16.7) | ||
| 4 | 3 (15.8) | 3 ( 16.7) | ||
| noinfo | 1 ( 5.3) | 3 ( 16.7) | ||
| MG_piglet_addfeedage (%) | 0.767 | |||
| <7 | 5 (26.3) | 6 ( 33.3) | ||
| >20 | 1 ( 5.3) | 0 ( 0.0) | ||
| 7-14 | 7 (36.8) | 6 ( 33.3) | ||
| noinfo | 6 (31.6) | 6 ( 33.3) | ||
| MG_ind_feed = 1 (%) | 13 (68.4) | 14 ( 77.8) | 0.787 | |
| MG_PREG_toy (%) | 0.002 | |||
| 0 | 0 ( 0.0) | 4 ( 22.2) | ||
| 1 | 0 ( 0.0) | 6 ( 33.3) | ||
| 2 | 10 (52.6) | 5 ( 27.8) | ||
| 3 | 9 (47.4) | 2 ( 11.1) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.6) | ||
| MG_BR_toy (%) | 0.043 | |||
| 0 | 1 ( 5.3) | 3 ( 16.7) | ||
| 1 | 4 (21.1) | 8 ( 44.4) | ||
| 2 | 5 (26.3) | 2 ( 11.1) | ||
| 3 | 7 (36.8) | 1 ( 5.6) | ||
| group | 2 (10.5) | 1 ( 5.6) | ||
| noinfo | 0 ( 0.0) | 3 ( 16.7) | ||
| MG_FAR_toy (%) | 0.413 | |||
| 1 ( 5.3) | 0 ( 0.0) | |||
| 0 | 0 ( 0.0) | 2 ( 11.1) | ||
| 1 | 4 (21.1) | 4 ( 22.2) | ||
| 2 | 11 (57.9) | 10 ( 55.6) | ||
| 3 | 3 (15.8) | 1 ( 5.6) | ||
| noinfo | 0 ( 0.0) | 1 ( 5.6) | ||
| OUT_SOWmortpro (mean (sd)) | 7.47 (4.19) | 11.00 (5.32) | 0.031 | |
| OUT_SOWmortdic = 1 (%) | 6 (31.6) | 12 ( 66.7) | 0.071 | |
| OUT_SOWcullpro (mean (sd)) | 10.26 (7.40) | 14.72 (7.40) | 0.076 | |
| OUT_SOWculldic = 1 (%) | 7 (36.8) | 10 ( 55.6) | 0.417 | |
| OUT_JOKUHYLK_01 = 2 (%) | 0 ( 0.0) | 18 (100.0) | <0.001 |
res_mca = MCA(med, quanti.sup = c(33,35) ,quali.sup=37, graph = FALSE)
summary(res_mca)
##
## Call:
## MCA(X = med, quanti.sup = c(33, 35), quali.sup = 37, graph = FALSE)
##
##
## Eigenvalues
## Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 Dim.6
## Variance 0.282 0.269 0.241 0.208 0.198 0.181
## % of var. 6.040 5.749 5.155 4.443 4.225 3.878
## Cumulative % of var. 6.040 11.789 16.944 21.387 25.612 29.490
## Dim.7 Dim.8 Dim.9 Dim.10 Dim.11 Dim.12
## Variance 0.173 0.167 0.165 0.160 0.149 0.144
## % of var. 3.694 3.570 3.521 3.411 3.185 3.073
## Cumulative % of var. 33.185 36.755 40.276 43.687 46.872 49.944
## Dim.13 Dim.14 Dim.15 Dim.16 Dim.17 Dim.18
## Variance 0.139 0.132 0.124 0.121 0.113 0.110
## % of var. 2.973 2.827 2.659 2.580 2.412 2.362
## Cumulative % of var. 52.917 55.744 58.403 60.983 63.395 65.756
## Dim.19 Dim.20 Dim.21 Dim.22 Dim.23 Dim.24
## Variance 0.106 0.104 0.100 0.096 0.095 0.091
## % of var. 2.257 2.232 2.133 2.050 2.032 1.955
## Cumulative % of var. 68.013 70.245 72.379 74.428 76.460 78.415
## Dim.25 Dim.26 Dim.27 Dim.28 Dim.29 Dim.30
## Variance 0.086 0.084 0.078 0.072 0.070 0.068
## % of var. 1.844 1.792 1.659 1.533 1.493 1.457
## Cumulative % of var. 80.259 82.051 83.711 85.243 86.736 88.193
## Dim.31 Dim.32 Dim.33 Dim.34 Dim.35 Dim.36
## Variance 0.064 0.062 0.057 0.055 0.051 0.050
## % of var. 1.375 1.321 1.208 1.166 1.098 1.065
## Cumulative % of var. 89.568 90.889 92.098 93.264 94.362 95.428
## Dim.37 Dim.38 Dim.39 Dim.40 Dim.41 Dim.42
## Variance 0.045 0.042 0.037 0.032 0.030 0.027
## % of var. 0.966 0.908 0.796 0.691 0.633 0.578
## Cumulative % of var. 96.394 97.302 98.098 98.789 99.422 100.000
##
## Individuals (the 10 first)
## Dim.1 ctr cos2 Dim.2 ctr
## 1 | -0.251 0.520 0.011 | 0.163 0.229
## 2 | -0.408 1.370 0.036 | 0.049 0.021
## 3 | -0.224 0.413 0.011 | 0.000 0.000
## 4 | -0.027 0.006 0.000 | -0.196 0.331
## 5 | 0.508 2.121 0.049 | 0.367 1.164
## 6 | -0.707 4.117 0.095 | -0.413 1.474
## 7 | -0.373 1.147 0.027 | -0.282 0.686
## 8 | 0.120 0.119 0.003 | 0.512 2.264
## 9 | 0.011 0.001 0.000 | 0.135 0.158
## 10 | 0.159 0.208 0.006 | 0.261 0.590
## cos2 Dim.3 ctr cos2
## 1 0.005 | 0.327 1.029 0.019 |
## 2 0.001 | -0.271 0.710 0.016 |
## 3 0.000 | 0.249 0.597 0.014 |
## 4 0.009 | 0.168 0.271 0.006 |
## 5 0.026 | 0.534 2.755 0.055 |
## 6 0.032 | -0.337 1.093 0.022 |
## 7 0.016 | -0.173 0.287 0.006 |
## 8 0.057 | 0.004 0.000 0.000 |
## 9 0.006 | -0.145 0.203 0.007 |
## 10 0.018 | 0.375 1.359 0.036 |
##
## Categories (the 10 first)
## Dim.1 ctr cos2 v.test Dim.2
## MG_sowsincratespostmix_0 | -0.213 0.318 0.094 -1.983 | -0.110
## MG_sowsincratespostmix_1 | 0.645 0.201 0.020 0.923 | 0.195
## MG_sowsincratespostmix_2 | -0.420 0.128 0.013 -0.745 | -0.122
## MG_sowsincratespostmix_3 | 1.359 0.447 0.044 1.359 | 4.185
## MG_sowsincratespostmix_5 | 0.318 0.025 0.002 0.318 | 0.229
## MG_sowsincratespostmix_7 | -0.050 0.001 0.000 -0.050 | -0.377
## MG_sowsincratespostmix_noinfo | 0.752 0.821 0.092 1.961 | -0.144
## MG_rootingmat_0 | 0.634 1.166 0.155 2.554 | -0.452
## MG_rootingmat_1 | -0.347 0.525 0.087 -1.908 | -0.014
## MG_rootingmat_2 | -0.192 0.108 0.014 -0.776 | 0.590
## ctr cos2 v.test Dim.3 ctr cos2
## MG_sowsincratespostmix_0 0.090 0.025 -1.028 | -0.123 0.125 0.031
## MG_sowsincratespostmix_1 0.019 0.002 0.279 | 0.932 0.493 0.042
## MG_sowsincratespostmix_2 0.011 0.001 -0.217 | 0.123 0.013 0.001
## MG_sowsincratespostmix_3 4.456 0.417 4.185 | -0.575 0.094 0.008
## MG_sowsincratespostmix_5 0.013 0.001 0.229 | 0.034 0.000 0.000
## MG_sowsincratespostmix_7 0.036 0.003 -0.377 | 0.341 0.033 0.003
## MG_sowsincratespostmix_noinfo 0.032 0.003 -0.376 | 0.257 0.113 0.011
## MG_rootingmat_0 0.623 0.079 -1.821 | -0.306 0.319 0.036
## MG_rootingmat_1 0.001 0.000 -0.074 | 0.026 0.003 0.000
## MG_rootingmat_2 1.063 0.135 2.379 | -0.125 0.053 0.006
## v.test
## MG_sowsincratespostmix_0 -1.150 |
## MG_sowsincratespostmix_1 1.334 |
## MG_sowsincratespostmix_2 0.218 |
## MG_sowsincratespostmix_3 -0.575 |
## MG_sowsincratespostmix_5 0.034 |
## MG_sowsincratespostmix_7 0.341 |
## MG_sowsincratespostmix_noinfo 0.671 |
## MG_rootingmat_0 -1.234 |
## MG_rootingmat_1 0.144 |
## MG_rootingmat_2 -0.504 |
##
## Categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## MG_sowsincratespostmix | 0.186 0.426 0.071 |
## MG_rootingmat | 0.194 0.201 0.545 |
## MG_mixing_1ok_2tmp_3notmp_4oktmp | 0.014 0.281 0.063 |
## MG_owngilts | 0.291 0.122 0.055 |
## MG_owngilts.1 | 0.226 0.090 0.002 |
## MG_giltpurchage_NUM | 0.235 0.733 0.043 |
## MG_giltchangebeforeins | 0.036 0.095 0.080 |
## MG_giltflush | 0.341 0.675 0.131 |
## MG_giltboarstart | 0.290 0.655 0.307 |
## MG_giltinsage | 0.173 0.740 0.280 |
##
## Supplementary categories
## Dim.1 cos2 v.test Dim.2 cos2
## OUT_JOKUHYLK_01.NA | -0.618 0.062 -1.614 | -0.113 0.002
## OUT_JOKUHYLK_01_1 | -0.021 0.000 -0.123 | 0.271 0.058
## OUT_JOKUHYLK_01_2 | 0.229 0.038 1.257 | -0.249 0.045
## v.test Dim.3 cos2 v.test
## OUT_JOKUHYLK_01.NA -0.294 | -0.494 0.040 -1.289 |
## OUT_JOKUHYLK_01_1 1.565 | -0.072 0.004 -0.414 |
## OUT_JOKUHYLK_01_2 -1.368 | 0.240 0.042 1.321 |
##
## Supplementary categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## OUT_JOKUHYLK_01 | 0.075 0.060 0.060 |
##
## Supplementary continuous variables
## Dim.1 Dim.2 Dim.3
## OUT_SOWmortpro | 0.186 | -0.254 | 0.350 |
## OUT_SOWcullpro | 0.089 | -0.224 | 0.307 |
To visualize the percentage of inertia explained by each MCA dimension:
eig.val <- res_mca$eig
barplot(eig.val[, 2],
names.arg = 1:nrow(eig.val),
main = "Variances Explained by Dimensions (%)",
xlab = "Principal Dimensions",
ylab = "Percentage of variances",
col ="steelblue")
# Add connected line segments to the plot
lines(x = 1:nrow(eig.val), eig.val[, 2],
type = "b", pch = 19, col = "red")
res <- explor::prepare_results(res_mca)
explor::MCA_var_plot(res, xax = 1, yax = 2,
var_sup = TRUE, var_lab_min_contrib = 0,
col_var = "Variable", symbol_var = "Type",
size_var = NULL, size_range = c(10, 300),
labels_size = 10, point_size = 56,
transitions = TRUE, labels_positions = NULL)
res <- explor::prepare_results(res_mca)
explor::MCA_ind_plot(res, xax = 1, yax = 2,ind_sup = FALSE,
lab_var = NULL, , ind_lab_min_contrib = 0,
col_var = NULL, labels_size = 9,
point_opacity = 0.5, opacity_var = NULL, point_size = 64,
ellipses = FALSE, transitions = TRUE, labels_positions = NULL)
fviz_mca_var(res_mca, choice = "quanti.sup",
ggtheme = theme_minimal())
## ```{r, echo = FALSE}
## res.hcpc = HCPC(res, nb.clust = -1, graph = FALSE)
## ```
##
## ```
## drawn <-
## c("41", "24", "21", "37", "6", "28", "38", "33", "43", "5")
## par(mar = c(4.1, 4.1, 1.1, 2.1))
## plot.HCPC(res.hcpc, choice = 'map', draw.tree = FALSE, select = drawn, title = '')
## ```
##
## **Figure - Ascending Hierarchical Classification of the individuals.**
## *The classification made on individuals reveals 6 clusters.*
##
##
## The cluster 1 is made of individuals such as*. This group is characterized by28* and *28*. :
##
## - high frequency for factors like *MG_giltboarstart=MG_giltboarstart_6*, *MG_nestmat=MG_nestmat__CUT*, *MG_ToFarunitNUM=MG_ToFarunitNUM_6*, *MG_insonce=MG_insonce_8*, *MG_giltpurchage_NUM=MG_giltpurchage_NUM_8*, *MG_owngilts=MG_owngilts_80*, *MG_giltchangebeforeins=MG_giltchangebeforeins_0*, *MG_rootingmat=MG_rootingmat_2*, *MG_instriple=MG_instriple_1* and *MG_artinspro=MG_artinspro_99* (factors are sorted from the most common).
## - low frequency for the factors *MG_artinspro=MG_artinspro_100* and *MG_giltchangebeforeins=MG_giltchangebeforeins_1* (factors are sorted from the rarest).
##
## The cluster 2 is made of individuals such as*. This group is characterized by6* and *6*. :
##
## - high frequency for factors like *MG_nopregus=MG_nopregus_0*, *MG_piglet_rem_age=MG_piglet_rem_age_1,5*, *MG_Nestmatdays=MG_Nestmatdays_7*, *MG_heatmarkback=MG_heatmarkback_0*, *MG_instriple.1=MG_instriple.1_0*, *MG_instriple=MG_instriple_0*, *MG_farmsemen=MG_farmsemen_0*, *MG_PREG_toy=MG_PREG_toy_3*, *MG_ToFarunitNUM=MG_ToFarunitNUM_7* and *MG_heatdetec_startNUM=MG_heatdetec_startNUM_noinfo* (factors are sorted from the most common).
## - low frequency for the factors *MG_nopregus=MG_nopregus_1*, *MG_heatgroup=MG_heatgroup_noinfo*, *MG_PREG_toy=MG_PREG_toy_2*, *MG_instriple.1=MG_instriple.1_1*, *MG_nestmat=MG_nestmat_noinfo* and *MG_BR_toy=MG_BR_toy_1* (factors are sorted from the rarest).
##
## The 1st cluster is made of individuals such as *5*. This group is characterized by :
##
## - high frequency for the factors *MG_instriple=MG_instriple_10*, *MG_nopregus=MG_nopregus_1*, *MG_instriple.1=MG_instriple.1_1*, *MG_artinspro=MG_artinspro_100*, *MG_piglet_rem_amountCAT=MG_piglet_rem_amountCAT_4*, *MG_giltinsage=MG_giltinsage_8,5*, *OUT_SOWculldic=OUT_SOWculldic_1*, *MG_piglet_rem_age=MG_piglet_rem_age_0,5*, *MG_piglet_addfeedage=MG_piglet_addfeedage_<7* and *MG_heatgroup=MG_heatgroup_noinfo* (factors are sorted from the most common).
## - low frequency for the factors *MG_nopregus=MG_nopregus_0*, *MG_nopregus=MG_nopregus_noinfo*, *MG_sowsincratespostmix=MG_sowsincratespostmix_0*, *MG_heatmarkback=MG_heatmarkback_0*, *MG_giltinsage=MG_giltinsage_noinfo* and *MG_nestmat=MG_nestmat_STR* (factors are sorted from the rarest).
##
## The 1st cluster is made of individuals such as *43*. This group is characterized by :
##
## - high frequency for the factors *MG_farassist=MG_farassist_GLO_LUBR*, *MG_instriple=MG_instriple_33*, *MG_insonce=MG_insonce_7*, *MG_heatdetec_startNUM=MG_heatdetec_startNUM_4*, *MG_rootingmat=MG_rootingmat_MG_rootingmat*, *MG_FAR_toy=MG_FAR_toy_0* and *MG_instriple.1=MG_instriple.1_2* (factors are sorted from the most common).
##
## The cluster 5 is made of individuals such as*. This group is characterized by37* and *37*. :
##
## - high frequency for factors like *MG_giltinsage=MG_giltinsage_0*, *MG_giltboarstart=MG_giltboarstart_0*, *MG_giltflush=MG_giltflush_noneed*, *MG_heatdetec_startNUM=MG_heatdetec_startNUM_1*, *MG_Nestmatdays=MG_Nestmatdays_5*, *MG_nopregus=MG_nopregus_2*, *MG_mixing_1ok_2tmp_3notmp_4oktmp=MG_mixing_1ok_2tmp_3notmp_4oktmp_1*, *MG_FAR_toy=MG_FAR_toy_1*, *MG_instriple=MG_instriple_5* and *MG_farmsemen=MG_farmsemen_20* (factors are sorted from the most common).
## - low frequency for the factor **.
##
## The cluster 6 is made of individuals such as*. This group is characterized by21* and *21*. :
##
## - high frequency for factors like *MG_piglet_rem_age=MG_piglet_rem_age_*, *MG_instriple.1=MG_instriple.1_noinfo*, *MG_instriple=MG_instriple_noinfo*, *MG_insonce=MG_insonce_noinfo*, *MG_piglet_rem_amountCAT=MG_piglet_rem_amountCAT_noinfo*, *MG_nestmatamount=MG_nestmatamount_noinfo*, *MG_Nestmatdays=MG_Nestmatdays_noinfo*, *MG_giltflush=MG_giltflush_noinfo*, *MG_heatmarkback=MG_heatmarkback_noinfo* and *MG_giltinsage=MG_giltinsage_noinfo* (factors are sorted from the most common).
## **Results for the Hierarchical Clustering on Principal Components**
## name
## 1 "$data.clust"
## 2 "$desc.var"
## 3 "$desc.var$test.chi2"
## 4 "$desc.axes$category"
## 5 "$desc.axes"
## 6 "$desc.axes$quanti.var"
## 7 "$desc.axes$quanti"
## 8 "$desc.ind"
## 9 "$desc.ind$para"
## 10 "$desc.ind$dist"
## 11 "$call"
## 12 "$call$t"
## description
## 1 "dataset with the cluster of the individuals"
## 2 "description of the clusters by the variables"
## 3 "description of the cluster var. by the categorical var."
## 4 "description of the clusters by the categories."
## 5 "description of the clusters by the dimensions"
## 6 "description of the cluster var. by the axes"
## 7 "description of the clusters by the axes"
## 8 "description of the clusters by the individuals"
## 9 "parangons of each clusters"
## 10 "specific individuals"
## 11 "summary statistics"
## 12 "description of the tree"
# load data
setwd("~/GitHub/tilataso")
library(readr)
library(FactoMineR)
library(FactoInvestigate)
library(factoextra)
library(dplyr)
library(explor)
med<-read.csv(file="vac.csv", header=TRUE)
med<-med%>%mutate_all(as.factor)
med$OUT_SOWcullpro<-as.numeric(med$OUT_SOWcullpro)
med$OUT_SOWmortpro<-as.numeric(med$OUT_SOWmortpro)
medcat<-med %>% select(-ends_with("pro"))
mednum<-med %>% select(ends_with("pro"))
colnames(medcat)
## [1] "V_ery" "V_parvo" "V_coli"
## [4] "V_sirco" "V_ClC" "V_ClA"
## [7] "V_SI" "V_APP" "OUT_SOWmortdic"
## [10] "OUT_SOWculldic" "OUT_JOKUHYLK_01"
library(tidyr)
gather(medcat) %>% ggplot(aes(value)) + facet_wrap("key", scales = "free") + geom_bar(fill="green") + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8))+ scale_fill_manual("key")
library(dplyr)
library(ggplot2)
out<-med %>% dplyr::select(ends_with("pro"))
#Matrix of plots
ggpairs(out, lower = list(combo = wrap("facethist", bins = 20)), title="Graphical overview of the 2 outcome variables")
library(tableone)
KreateTableOne = function(x, ...){
t1 = tableone::CreateTableOne(data=x, ...)
t2 = print(t1, quote=TRUE)
rownames(t2) = gsub(pattern='\\"', replacement='', rownames(t2))
colnames(t2) = gsub(pattern='\\"', replacement='', colnames(t2))
return(t2)
}
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table1 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWmortdic')
table1%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow mortality") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 23 | 20 | ||
| V_ery = 2 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| V_parvo = 2 (%) | 0 ( 0.0) | 1 ( 5.0) | 0.944 | |
| V_coli (%) | 0.760 | |||
| 0 | 1 ( 4.3) | 1 ( 5.0) | ||
| 1 | 21 ( 91.3) | 17 ( 85.0) | ||
| 2 | 1 ( 4.3) | 2 ( 10.0) | ||
| V_sirco = 1 (%) | 8 ( 34.8) | 5 ( 25.0) | 0.716 | |
| V_ClC = 1 (%) | 1 ( 4.3) | 2 ( 10.0) | 0.900 | |
| V_ClA = 0 (%) | 23 (100.0) | 20 (100.0) | NA | |
| V_SI = 1 (%) | 1 ( 4.3) | 3 ( 15.0) | 0.501 | |
| V_APP = 1 (%) | 3 ( 13.0) | 2 ( 10.0) | 1.000 | |
| OUT_SOWmortpro (mean (sd)) | 4.74 (2.12) | 13.35 (3.27) | <0.001 | |
| OUT_SOWmortdic = 1 (%) | 0 ( 0.0) | 20 (100.0) | <0.001 | |
| OUT_SOWcullpro (mean (sd)) | 8.81 (6.62) | 17.89 (6.29) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 5 ( 23.8) | 14 ( 77.8) | 0.002 | |
| OUT_JOKUHYLK_01 = 2 (%) | 6 ( 31.6) | 12 ( 66.7) | 0.071 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table2 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_SOWculldic')
table2%>%
kable("html", align = "rrr", caption = "Data variable summary strat by Sow cull") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 0 | 1 | p | test | |
|---|---|---|---|---|
| n | 20 | 19 | ||
| V_ery = 2 (%) | 1 ( 5.0) | 0 ( 0.0) | 1.000 | |
| V_parvo = 2 (%) | 1 ( 5.0) | 0 ( 0.0) | 1.000 | |
| V_coli (%) | 0.367 | |||
| 0 | 1 ( 5.0) | 1 ( 5.3) | ||
| 1 | 17 ( 85.0) | 18 ( 94.7) | ||
| 2 | 2 ( 10.0) | 0 ( 0.0) | ||
| V_sirco = 1 (%) | 7 ( 35.0) | 5 ( 26.3) | 0.810 | |
| V_ClC = 1 (%) | 1 ( 5.0) | 2 ( 10.5) | 0.963 | |
| V_ClA = 0 (%) | 20 (100.0) | 19 (100.0) | NA | |
| V_SI = 1 (%) | 1 ( 5.0) | 3 ( 15.8) | 0.560 | |
| V_APP = 1 (%) | 4 ( 20.0) | 1 ( 5.3) | 0.370 | |
| OUT_SOWmortpro (mean (sd)) | 6.15 (3.57) | 11.53 (5.36) | 0.001 | |
| OUT_SOWmortdic = 1 (%) | 4 ( 20.0) | 14 ( 73.7) | 0.002 | |
| OUT_SOWcullpro (mean (sd)) | 6.40 (3.12) | 19.95 (4.55) | <0.001 | |
| OUT_SOWculldic = 1 (%) | 0 ( 0.0) | 19 (100.0) | <0.001 | |
| OUT_JOKUHYLK_01 = 2 (%) | 8 ( 40.0) | 10 ( 58.8) | 0.417 |
#This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be #called in a code chunk with \code{results='hide'} to hide the plain test results printed from #\code{tableone::CreateTableOne}. The resulting data frame should be saved as an object and used #in a second code chunk for formatted printing. Suggestions for improvement are welcomed.
table3 = KreateTableOne(x=med, factorVars=colnames(medcat), strata='OUT_JOKUHYLK_01')
table3%>%
kable("html", align = "rrr", caption = "Data variable summary strat by JOKUHYLK") %>%
kable_styling(bootstrap_options = c("hover", "condensed")) %>%
scroll_box(height = "300px" )
| 1 | 2 | p | test | |
|---|---|---|---|---|
| n | 19 | 18 | ||
| V_ery = 2 (%) | 0 ( 0.0) | 1 ( 5.6) | 0.978 | |
| V_parvo = 2 (%) | 0 ( 0.0) | 1 ( 5.6) | 0.978 | |
| V_coli (%) | 0.325 | |||
| 0 | 0 ( 0.0) | 2 ( 11.1) | ||
| 1 | 18 ( 94.7) | 15 ( 83.3) | ||
| 2 | 1 ( 5.3) | 1 ( 5.6) | ||
| V_sirco = 1 (%) | 7 ( 36.8) | 5 ( 27.8) | 0.812 | |
| V_ClC = 1 (%) | 1 ( 5.3) | 2 ( 11.1) | 0.961 | |
| V_ClA = 0 (%) | 19 (100.0) | 18 (100.0) | NA | |
| V_SI = 1 (%) | 0 ( 0.0) | 4 ( 22.2) | 0.100 | |
| V_APP = 1 (%) | 4 ( 21.1) | 1 ( 5.6) | 0.370 | |
| OUT_SOWmortpro (mean (sd)) | 7.47 (4.19) | 11.00 (5.32) | 0.031 | |
| OUT_SOWmortdic = 1 (%) | 6 ( 31.6) | 12 ( 66.7) | 0.071 | |
| OUT_SOWcullpro (mean (sd)) | 10.26 (7.40) | 14.72 (7.40) | 0.076 | |
| OUT_SOWculldic = 1 (%) | 7 ( 36.8) | 10 ( 55.6) | 0.417 | |
| OUT_JOKUHYLK_01 = 2 (%) | 0 ( 0.0) | 18 (100.0) | <0.001 |
res_mca = MCA(med, quanti.sup = c(9,11) ,quali.sup=13, graph = FALSE)
summary(res_mca)
##
## Call:
## MCA(X = med, quanti.sup = c(9, 11), quali.sup = 13, graph = FALSE)
##
##
## Eigenvalues
## Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 Dim.6
## Variance 0.256 0.173 0.166 0.116 0.098 0.088
## % of var. 23.306 15.742 15.063 10.532 8.877 8.029
## Cumulative % of var. 23.306 39.048 54.110 64.643 73.519 81.548
## Dim.7 Dim.8 Dim.9 Dim.10 Dim.11
## Variance 0.076 0.051 0.043 0.033 0.000
## % of var. 6.871 4.624 3.921 3.035 0.000
## Cumulative % of var. 88.420 93.043 96.965 100.000 100.000
##
## Individuals (the 10 first)
## Dim.1 ctr cos2 Dim.2 ctr cos2 Dim.3
## 1 | -0.106 0.103 0.024 | -0.202 0.547 0.085 | 0.455
## 2 | -0.033 0.010 0.004 | -0.346 1.607 0.407 | 0.258
## 3 | -0.127 0.146 0.053 | -0.198 0.528 0.129 | -0.155
## 4 | -0.062 0.035 0.012 | 0.030 0.012 0.003 | -0.496
## 5 | -0.062 0.035 0.012 | 0.030 0.012 0.003 | -0.496
## 6 | -0.127 0.146 0.053 | -0.198 0.528 0.129 | -0.155
## 7 | 0.031 0.009 0.003 | -0.118 0.187 0.043 | -0.083
## 8 | 0.031 0.009 0.003 | -0.118 0.187 0.043 | -0.083
## 9 | -0.127 0.146 0.053 | -0.198 0.528 0.129 | -0.155
## 10 | -0.106 0.103 0.024 | -0.202 0.547 0.085 | 0.455
## ctr cos2
## 1 2.907 0.430 |
## 2 0.938 0.227 |
## 3 0.338 0.079 |
## 4 3.457 0.738 |
## 5 3.457 0.738 |
## 6 0.338 0.079 |
## 7 0.096 0.021 |
## 8 0.096 0.021 |
## 9 0.338 0.079 |
## 10 2.907 0.430 |
##
## Categories (the 10 first)
## Dim.1 ctr cos2 v.test Dim.2 ctr cos2
## V_ery_1 | -0.145 0.802 0.884 -6.093 | -0.032 0.058 0.043
## V_ery_2 | 6.093 33.674 0.884 6.093 | 1.347 2.436 0.043
## V_parvo_1 | -0.145 0.802 0.884 -6.093 | -0.032 0.058 0.043
## V_parvo_2 | 6.093 33.674 0.884 6.093 | 1.347 2.436 0.043
## V_coli_0 | -0.016 0.000 0.000 -0.023 | -0.956 2.457 0.045
## V_coli_1 | -0.218 1.635 0.360 -3.891 | 0.042 0.090 0.013
## V_coli_2 | 2.769 20.866 0.575 4.914 | 0.107 0.046 0.001
## V_sirco_0 | 0.112 0.340 0.029 1.100 | -0.181 1.323 0.076
## V_sirco_1 | -0.258 0.785 0.029 -1.100 | 0.418 3.053 0.076
## V_ClC_0 | 0.055 0.110 0.041 1.304 | -0.200 2.159 0.536
## v.test Dim.3 ctr cos2 v.test
## V_ery_1 -1.347 | -0.007 0.003 0.002 -0.291 |
## V_ery_2 1.347 | 0.291 0.119 0.002 0.291 |
## V_parvo_1 -1.347 | -0.007 0.003 0.002 -0.291 |
## V_parvo_2 1.347 | 0.291 0.119 0.002 0.291 |
## V_coli_0 -1.369 | -0.769 1.661 0.029 -1.101 |
## V_coli_1 0.749 | 0.021 0.024 0.003 0.379 |
## V_coli_2 0.190 | 0.244 0.250 0.004 0.433 |
## V_sirco_0 -1.784 | -0.242 2.465 0.135 -2.382 |
## V_sirco_1 1.784 | 0.558 5.688 0.135 2.382 |
## V_ClC_0 -4.744 | -0.064 0.233 0.055 -1.523 |
##
## Categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## V_ery | 0.884 0.043 0.002 |
## V_parvo | 0.884 0.043 0.002 |
## V_coli | 0.577 0.045 0.032 |
## V_sirco | 0.029 0.076 0.135 |
## V_ClC | 0.041 0.536 0.055 |
## V_ClA | 0.000 0.000 0.000 |
## V_SI | 0.031 0.346 0.015 |
## V_APP | 0.033 0.268 0.280 |
## OUT_SOWmortdic | 0.027 0.224 0.480 |
## OUT_SOWculldic | 0.059 0.150 0.657 |
##
## Supplementary categories
## Dim.1 cos2 v.test Dim.2 cos2 v.test Dim.3
## OUT_JOKUHYLK_01.NA | 0.107 0.002 0.279 | -0.688 0.077 -1.796 | -0.376
## OUT_JOKUHYLK_01_1 | -0.148 0.017 -0.856 | -0.114 0.010 -0.658 | 0.420
## OUT_JOKUHYLK_01_2 | 0.121 0.011 0.666 | 0.350 0.088 1.924 | -0.318
## cos2 v.test
## OUT_JOKUHYLK_01.NA 0.023 -0.980 |
## OUT_JOKUHYLK_01_1 0.140 2.422 |
## OUT_JOKUHYLK_01_2 0.073 -1.749 |
##
## Supplementary categorical variables (eta2)
## Dim.1 Dim.2 Dim.3
## OUT_JOKUHYLK_01 | 0.017 0.123 0.140 |
##
## Supplementary continuous variables
## Dim.1 Dim.2 Dim.3
## OUT_SOWmortpro | 0.004 | 0.381 | -0.671 |
## OUT_SOWcullpro | -0.178 | 0.323 | -0.768 |
To visualize the percentage of inertia explained by each MCA dimension:
eig.val <- res_mca$eig
barplot(eig.val[, 2],
names.arg = 1:nrow(eig.val),
main = "Variances Explained by Dimensions (%)",
xlab = "Principal Dimensions",
ylab = "Percentage of variances",
col ="steelblue")
# Add connected line segments to the plot
lines(x = 1:nrow(eig.val), eig.val[, 2],
type = "b", pch = 19, col = "red")
res <- explor::prepare_results(res_mca)
explor::MCA_var_plot(res, xax = 1, yax = 2,
var_sup = TRUE, var_lab_min_contrib = 0,
col_var = "Variable", symbol_var = "Type",
size_var = NULL, size_range = c(10, 300),
labels_size = 10, point_size = 56,
transitions = TRUE, labels_positions = NULL)
res <- explor::prepare_results(res_mca)
explor::MCA_ind_plot(res, xax = 1, yax = 2,ind_sup = FALSE,
lab_var = NULL, , ind_lab_min_contrib = 0,
col_var = NULL, labels_size = 9,
point_opacity = 0.5, opacity_var = NULL, point_size = 64,
ellipses = FALSE, transitions = TRUE, labels_positions = NULL)
fviz_mca_var(res_mca, choice = "quanti.sup",
ggtheme = theme_minimal())
## ```{r, echo = FALSE}
## res.hcpc = HCPC(res, nb.clust = -1, graph = FALSE)
## ```
##
## ```
## drawn <-
## c("40", "43", "13", "19", "20", "22", "11", "2", "41", "18")
## par(mar = c(4.1, 4.1, 1.1, 2.1))
## plot.HCPC(res.hcpc, choice = 'map', draw.tree = FALSE, select = drawn, title = '')
## ```
##
## **Figure - Ascending Hierarchical Classification of the individuals.**
## *The classification made on individuals reveals 5 clusters.*
##
##
## The cluster 1 is made of individuals such as*. This group is characterized by13* and *13*. :
##
## - high frequency for the factors *V_APP=V_APP_1* and *V_ClC=V_ClC_1* (factors are sorted from the most common).
## - low frequency for the factors *V_APP=V_APP_0* and *V_ClC=V_ClC_0* (factors are sorted from the rarest).
##
## The cluster 2 is made of individuals sharing :
##
## - high frequency for the factors *OUT_SOWculldic=OUT_SOWculldic_1*, *OUT_SOWmortdic=OUT_SOWmortdic_1*, *V_sirco=V_sirco_0* and *V_APP=V_APP_0* (factors are sorted from the most common).
## - low frequency for the factors *OUT_SOWculldic=OUT_SOWculldic_0*, *OUT_SOWmortdic=OUT_SOWmortdic_0*, *V_sirco=V_sirco_1* and *V_APP=V_APP_1* (factors are sorted from the rarest).
##
## The cluster 3 is made of individuals such as*. This group is characterized by2* and *2*. :
##
## - high frequency for the factors *OUT_SOWmortdic=OUT_SOWmortdic_0*, *OUT_SOWculldic=OUT_SOWculldic_0* and *V_sirco=V_sirco_1* (factors are sorted from the most common).
## - low frequency for the factors *OUT_SOWmortdic=OUT_SOWmortdic_1*, *OUT_SOWculldic=OUT_SOWculldic_1* and *V_sirco=V_sirco_0* (factors are sorted from the rarest).
##
## The cluster 4 is made of individuals sharing :
##
## - high frequency for the factors *OUT_SOWculldic=OUT_SOWculldic.NA* and *OUT_JOKUHYLK_01=OUT_JOKUHYLK_01.NA* (factors are sorted from the most common).
##
## The 1st cluster is made of individuals such as *40*. This group is characterized by :
##
## - high frequency for the factors *V_parvo=V_parvo_2* and *V_ery=V_ery_2* (factors are sorted from the most common).
## - low frequency for the factors *V_ery=V_ery_1* and *V_parvo=V_parvo_1* (factors are sorted from the rarest).
## **Results for the Hierarchical Clustering on Principal Components**
## name
## 1 "$data.clust"
## 2 "$desc.var"
## 3 "$desc.var$quanti.var"
## 4 "$desc.var$quanti"
## 5 "$desc.var$test.chi2"
## 6 "$desc.axes$category"
## 7 "$desc.axes"
## 8 "$desc.axes$quanti.var"
## 9 "$desc.axes$quanti"
## 10 "$desc.ind"
## 11 "$desc.ind$para"
## 12 "$desc.ind$dist"
## 13 "$call"
## 14 "$call$t"
## description
## 1 "dataset with the cluster of the individuals"
## 2 "description of the clusters by the variables"
## 3 "description of the cluster var. by the continuous var."
## 4 "description of the clusters by the continuous var."
## 5 "description of the cluster var. by the categorical var."
## 6 "description of the clusters by the categories."
## 7 "description of the clusters by the dimensions"
## 8 "description of the cluster var. by the axes"
## 9 "description of the clusters by the axes"
## 10 "description of the clusters by the individuals"
## 11 "parangons of each clusters"
## 12 "specific individuals"
## 13 "summary statistics"
## 14 "description of the tree"